Progress!

This commit is contained in:
Markus Hauschild
2013-05-31 23:51:44 +02:00
parent 713b5078cd
commit 28ca85b94e
9 changed files with 129 additions and 17 deletions

10
src/AST/ASTElement.cpp Normal file
View File

@@ -0,0 +1,10 @@
#include "AST/ASTElement.h"
#include "AST/ASTVisitor.h"
ASTElement::ASTElement() {
//
}
ASTElement::~ASTElement() {
//
}

10
src/AST/ASTVisitor.cpp Normal file
View File

@@ -0,0 +1,10 @@
#include "AST/ASTVisitor.h"
ASTVisitor::ASTVisitor() {
//
}
ASTVisitor::~ASTVisitor() {
//
}

15
src/Token.cpp Normal file
View 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_;
}

View File

@@ -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;
}