public bool Parse(string code, bool peformSemanticFixes=true) { var resultTokens = _lexer.BuildTextTokens(code); FileIncludeLogic.ScanAndImportIncludes(resultTokens); AstTree = _parser.Parse(resultTokens); if (peformSemanticFixes) { var semantic = new SemanticAnalysis(AstTree); semantic.Perform(); } return true; }
public static void GenerateCode() { var lexer = new Mq4Lexer(); var resultTokens = lexer.BuildTextTokens(ScriptUtils.ComplexCode); var parser = new Mq4Parser(); var astTree = parser.Parse(resultTokens); var semantic = new SemanticAnalysis(astTree); semantic.Perform(); var codeGenerator = new CsCodeGenerator(); codeGenerator.GenerateCodeForNode(astTree.Children[0]); }