Beispiel #1
0
        public virtual ParseTree Parse(string startRule, IList <NFAState> visitedStates)
        {
            ParseTreeBuilder actions = new ParseTreeBuilder(grammar.name);

            try
            {
                Parse(startRule, actions, visitedStates);
            }
            catch (RecognitionException /*re*/)
            {
                // Errors are tracked via the ANTLRDebugInterface
                // Exceptions are used just to blast out of the parse engine
                // The error will be in the parse tree.
            }
            return(actions.Tree);
        }
Beispiel #2
0
 public virtual ParseTree Parse( String startRule, IList visitedStates )
 {
     ParseTreeBuilder actions = new ParseTreeBuilder( grammar.name );
     try
     {
         Parse( startRule, actions, visitedStates );
     }
     catch ( RecognitionException /*re*/ )
     {
         // Errors are tracked via the ANTLRDebugInterface
         // Exceptions are used just to blast out of the parse engine
         // The error will be in the parse tree.
     }
     return actions.GetTree();
 }