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

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