public CodeBlockForOuterMostAlt(OutputModelFactory factory, Alternative alt) { super(factory); this.alt = alt; altLabel = alt.ast.altLabel!=null ? alt.ast.altLabel.getText() : null; } }
public CommonTree getFirstDescendantWithType(int type) { if ( getType()==type ) return this; if ( children==null ) return null; for (Object c : children) { GrammarAST t = (GrammarAST)c; if ( t.getType()==type ) return t; CommonTree d = t.getFirstDescendantWithType(type); if ( d!=null ) return d; } return null; }
@Override public Object dupNode(Object t) { if ( t==null ) return null; return ((GrammarAST)t).dupNode(); //create(((GrammarAST)t).token); }
public AltAST getOutermostAltNode() { if ( this instanceof AltAST && parent.parent instanceof RuleAST ) { return (AltAST)this; } if ( parent!=null ) return ((GrammarAST)parent).getOutermostAltNode(); return null; }
@Override public GrammarAST dupNode() { return new GrammarAST(this); }
@Override public SetAST dupNode() { return new SetAST(this); }
@Override public Object errorNode(org.antlr.runtime.TokenStream input, org.antlr.runtime.Token start, org.antlr.runtime.Token stop, org.antlr.runtime.RecognitionException e) { return new GrammarASTErrorNode(input, start, stop, e); } }
public CommonTree getFirstDescendantWithType(int type) { if ( getType()==type ) return this; if ( children==null ) return null; for (Object c : children) { GrammarAST t = (GrammarAST)c; if ( t.getType()==type ) return t; CommonTree d = t.getFirstDescendantWithType(type); if ( d!=null ) return d; } return null; }
public CodeBlockForOuterMostAlt(OutputModelFactory factory, Alternative alt) { super(factory); this.alt = alt; altLabel = alt.ast.altLabel!=null ? alt.ast.altLabel.getText() : null; } }
@Override public GrammarAST dupNode(Object t) { if ( t==null ) return null; return ((GrammarAST)t).dupNode(); //create(((GrammarAST)t).token); }
public AltAST getOutermostAltNode() { if ( this instanceof AltAST && parent.parent instanceof RuleAST ) { return (AltAST)this; } if ( parent!=null ) return ((GrammarAST)parent).getOutermostAltNode(); return null; }
public CommonTree getFirstDescendantWithType(int type) { if ( getType()==type ) return this; if ( children==null ) return null; for (Object c : children) { GrammarAST t = (GrammarAST)c; if ( t.getType()==type ) return t; CommonTree d = t.getFirstDescendantWithType(type); if ( d!=null ) return d; } return null; }
public CodeBlockForOuterMostAlt(OutputModelFactory factory, Alternative alt) { super(factory); this.alt = alt; altLabel = alt.ast.altLabel!=null ? alt.ast.altLabel.getText() : null; } }