private static Grammar.Module Load(string fileName) { using (var lexer = new PsiLexer(fileName)) { var parser = new PsiParser(lexer); var success = parser.Parse(); if (success) { return(parser.Result); } Console.WriteLine("Line: {0}", lexer.yylloc.StartLine); return(null); } }
protected static Module Load(string source) { using (var lexer = new PsiLexer(new StringReader(source), "???")) { var parser = new PsiParser(lexer); var success = parser.Parse(); if (success) { return(parser.Result); } else { return(null); } } }