forked from jasder/antlr
was processing grammar after syntax error.
This commit is contained in:
parent
c581faafc7
commit
0ac781aebf
|
@ -364,6 +364,8 @@ public class Tool {
|
|||
if ( g.ast!=null && internalOption_PrintGrammarTree ) System.out.println(g.ast.toStringTree());
|
||||
//g.ast.inspect();
|
||||
|
||||
if ( g.ast.hasErrors ) return;
|
||||
|
||||
int prevErrors = errMgr.getNumErrors();
|
||||
// MAKE SURE GRAMMAR IS SEMANTICALLY CORRECT (FILL IN GRAMMAR OBJECT)
|
||||
SemanticPipeline sem = new SemanticPipeline(g);
|
||||
|
|
|
@ -325,6 +325,7 @@ public class LeftRecursiveRuleAnalyzer extends LeftRecursiveRuleWalker {
|
|||
for (int i = 0; i < n; i++) {
|
||||
GrammarAST alt = (GrammarAST)blk.getChildren().get(i);
|
||||
Tree first = alt.getChild(0);
|
||||
if ( first==null ) continue;
|
||||
if ( first.getType()==RULE_REF && first.getText().equals(ruleName) ) return true;
|
||||
Tree rref = first.getChild(1);
|
||||
if ( rref!=null && rref.getType()==RULE_REF && rref.getText().equals(ruleName) ) return true;
|
||||
|
|
Loading…
Reference in New Issue