Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }