public DotGraph <TVertexId> Parse(TextReader reader) { var antlrStream = new ANTLRReaderStream(reader); var lexer = new DotGrammarLexer(antlrStream); var tokenStream = new CommonTokenStream(lexer); var parser = new DotGrammarParser(tokenStream); 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; }