public ConsoleTypeChecker() : base() { parser = new QLParser<IExprNode, IStmntNode>(); parser.Factory = factory = new QLFactory(); parser.OnReduction += OnReduction; parser.OnCompletion += OnCompletion; parser.OnGroupError += OnGroupError; parser.OnInternalError += OnInternalError; parser.OnNotLoadedError += OnNotLoadedError; parser.OnLexicalError += OnLexicalError; parser.OnSyntaxError += OnSyntaxError; Assembly a = typeof(QLParser<IExprNode, IStmntNode>).Assembly; parser.LoadGrammar(new BinaryReader(a.GetManifestResourceStream("QL_Grammar.Grammar.QL_Grammar.egt"))); parser.Parse(System.IO.File.OpenText(@"..\..\..\..\..\Grammar\QL_Test.txt")); }
private QLParser<IExprNode, IStmntNode> InitParser() { QLParser<IExprNode, IStmntNode> parser = new QLParser<IExprNode, IStmntNode>(); parser.Factory = new QLFactory(); Assembly a = typeof(QLParser<IExprNode, IStmntNode>).Assembly; parser.LoadGrammar(new BinaryReader(a.GetManifestResourceStream("QL_Grammar.Grammar.QL_Grammar.egt"))); return parser; }