158159160161162163164165166167168
} public AST create(int type, String txt) { AST t = create(type); if ( t!=null ) { t.initialize(type, txt); } return t; } /** Create an AST node with the token type and text passed in, but
171172173174175176177178179180181
* @since 2.7.2 */ public AST create(int type, String txt, String className) { AST t = create(className); if ( t!=null ) { t.initialize(type, txt); } return t; } /** Create a new empty AST node; if the user did not specify
183184185186187188189190191192193
*/ public AST create(AST tr) { if (tr == null) return null; // create(null) == null AST t = create(tr.getType()); if ( t!=null ) { t.initialize(tr); } return t; } public AST create(Token tok) {
191192193194195196197198199200201
} public AST create(Token tok) { AST t = create(tok.getType()); if ( t!=null ) { t.initialize(tok); } return t; } /** ANTLR generates reference to this when you reference a token
241242243244245246247248249250251
catch (NoSuchMethodException e){ // just do the regular thing if you can't find the ctor // Your AST must have default ctor to use this. t = create(c); if ( t!=null ) { t.initialize(token); } } } catch (Exception e) { throw new IllegalArgumentException("Invalid class or can't make instance, "+className);
279280281282283284285286287288289
public AST dup(AST t) { if ( t==null ) { return null; } AST dup_t = create(t.getClass()); dup_t.initialize(t); return dup_t; } /** Duplicate tree including siblings of root. */ public AST dupList(AST t) {
7980818283848586878889
public AST create(int paramInt) { Class localClass = getASTNodeType(paramInt); AST localAST = create(localClass); if (localAST != null) localAST.initialize(paramInt, ""); return localAST; } public AST create(int paramInt, String paramString) {
8788899091929394959697
public AST create(int paramInt, String paramString) { AST localAST = create(paramInt); if (localAST != null) localAST.initialize(paramInt, paramString); return localAST; } public AST create(int paramInt, String paramString1, String paramString2) {
9596979899100101102103104105
public AST create(int paramInt, String paramString1, String paramString2) { AST localAST = create(paramString2); if (localAST != null) localAST.initialize(paramInt, paramString1); return localAST; } public AST create(AST paramAST) {
105106107108109110111112113114115
{ if (paramAST == null) return null; AST localAST = create(paramAST.getType()); if (localAST != null) localAST.initialize(paramAST); return localAST; } public AST create(Token paramToken) {