186187188189190191192193194195196
*/ 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) {
194195196197198199200201202203204
} 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
250251252253254255256257258259260
// 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) { // for c# conversion
294295296297298299300301302303304
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) {