public static DotGraph <int> Parse(string content) { ANTLRStringStream antlrStream = new ANTLRStringStream(content); DotGrammarLexer lexer = new DotGrammarLexer(antlrStream); CommonTokenStream tokenStream = new CommonTokenStream(lexer); DotGrammarParser parser = new DotGrammarParser(tokenStream); IntDotGraphBuilder builder = new IntDotGraphBuilder(); parser.Builder = builder; parser.dot(); return(builder.DotGraph); }
private static DotGraph <int> Parse(string content) { var antlrStream = new ANTLRStringStream(content); var lexer = new DotGrammarLexer(antlrStream); var tokenStream = new CommonTokenStream(lexer); var parser = new DotGrammarParser(tokenStream); var builder = new IntDotGraphBuilder(); parser.Builder = builder; parser.dot(); return(builder.DotGraph); }
private static DotGraph <int> Parse(string content) { var antlrStream = new ANTLRStringStream(content); var lexer = new DotGrammarLexer(antlrStream); var tokenStream = new CommonTokenStream(lexer); var parser = new DotGrammarParser(tokenStream); var builder = new IntDotGraphBuilder(); parser.Builder = builder; // parser.dot(); try { parser.dot(); } catch (StackOverflowException e) { Console.WriteLine(e.Message + "\n" + e.StackTrace + "\n" + e.Source); } return(builder.DotGraph); }