Yet another compiler-compiler written in Kotlin. The target language is C++.
Its core tech is LR(1) optimized with hash and multi-thread programming.
Use maven to package.
We need you to write a yacc file. Here is an example yacc file of ANSI C.
Running JAR need two arguments
InputFile OutputFile
The input file is your yacc file. The output file is the C++ parser code we generated.
We provide function void yyparse(void)
to start parsing.
We do have declared variables and included a head file below
#include "yy.tab.h"
extern FILE* yyin;
extern FILE* yyout;
extern string yytext;
extern int column;
But these are generated by SeuLex. Do not implement them yourself.
You need to implement function void yyerror(void)
to deal with grammatical errors.
We prefer shift-in instead of reduce to solve IF-ELSE ambiguity. We did not consider priorities and integration.
And a too big output C++ file.
Branch master does not give any output unless you have written a usable yacc file like branch symbol which provides a real time symbol table output. There is another version to print a syntax tree. Check branch syntax_tree.