public static TreeNode compile(string gfile, string ifile) // SLR Parser { var g = new Grammar(gfile); SLRParser p = new SLRParser(g); var tokens = g.tokenize(ifile); return(p.parse(tokens)); }
public TablesForm(Syntactic syntactic, Semantic semantic) { _semantic = semantic; _syntactic = syntactic; _llanalyser = new LLParser(_semantic, _syntactic); _lrParser = new LRParser(_semantic, _syntactic); _slrParser = new SLRParser(_semantic, _syntactic); _lalrParser = new LALRParser(_semantic, _syntactic); InitializeComponent(); }
public static void compile(string srcfile, string asmfile, string objfile, string exefile) { var g = new Grammar(GrammarData.data, true); SLRParser p = new SLRParser(g); var tokens = g.tokenize(srcfile); TreeNode root = p.parse(tokens).Children[0]; asmCode.Clear(); labelCounter = 0; symtable = new SymbolTable(); stringPool = new Dictionary <string, string>(); programNodeCode(root); System.IO.File.WriteAllLines(asmfile, asmCode); ExeTools.ExeTools.Assemble(asmfile, objfile); ExeTools.ExeTools.Link(objfile, exefile); }