Progress!
This commit is contained in:
10
src/AST/ASTElement.cpp
Normal file
10
src/AST/ASTElement.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "AST/ASTElement.h"
|
||||
#include "AST/ASTVisitor.h"
|
||||
|
||||
ASTElement::ASTElement() {
|
||||
//
|
||||
}
|
||||
|
||||
ASTElement::~ASTElement() {
|
||||
//
|
||||
}
|
||||
10
src/AST/ASTVisitor.cpp
Normal file
10
src/AST/ASTVisitor.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "AST/ASTVisitor.h"
|
||||
|
||||
ASTVisitor::ASTVisitor() {
|
||||
//
|
||||
}
|
||||
|
||||
ASTVisitor::~ASTVisitor() {
|
||||
//
|
||||
}
|
||||
|
||||
15
src/Token.cpp
Normal file
15
src/Token.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/* The scully programming language.
|
||||
*
|
||||
* Copyright (c) Peter Dahlberg, Markus Hauschild and Florian Sattler, 2013.
|
||||
* Licensed under the GNU GPL v2.
|
||||
*/
|
||||
|
||||
#include "Token.h"
|
||||
|
||||
Token::Token(std::string text) : text_(text) {
|
||||
//
|
||||
}
|
||||
|
||||
std::string Token::getText() {
|
||||
return text_;
|
||||
}
|
||||
@@ -4,6 +4,8 @@
|
||||
* Licensed under the GNU GPL v2.
|
||||
*/
|
||||
|
||||
#include "Token.h"
|
||||
|
||||
// this file is auto generated from grammar/grammar.y
|
||||
#include "grammar.h"
|
||||
|
||||
@@ -59,6 +61,8 @@ int main() {
|
||||
|
||||
std::cout << "The scully programming languae v0.1" << std::endl;
|
||||
|
||||
void* parser = scullyParserAlloc(malloc);
|
||||
|
||||
while (true) {
|
||||
std::cout << "> ";
|
||||
std::string input;
|
||||
@@ -77,8 +81,11 @@ int main() {
|
||||
std::string s(results.start, results.end);
|
||||
if (results.id != T_WHITESPACE) {
|
||||
std::cout << "Id: " << results.id << ", Token: " << s << std::endl;
|
||||
scullyParser(parser, results.id, new Token(s));
|
||||
}
|
||||
} while (results.id != 0);
|
||||
}
|
||||
|
||||
scullyParserFree(parser, free);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user