Package antlr.collections

Examples of antlr.collections.AST.initialize()


  public AST create(Token paramToken)
  {
    AST localAST = create(paramToken.getType());
    if (localAST != null)
      localAST.initialize(paramToken);
    return localAST;
  }

  public AST create(Token paramToken, String paramString)
  {
View Full Code Here


      }
      catch (NoSuchMethodException localNoSuchMethodException)
      {
        localAST = create(localClass);
        if (localAST != null)
          localAST.initialize(paramToken);
      }
    }
    catch (Exception localException)
    {
      throw new IllegalArgumentException("Invalid class or can't make instance, " + paramString);
View Full Code Here

  public AST dup(AST paramAST)
  {
    if (paramAST == null)
      return null;
    AST localAST = create(paramAST.getClass());
    localAST.initialize(paramAST);
    return localAST;
  }

  public AST dupList(AST paramAST)
  {
View Full Code Here

    public AST create(int type) {
    Class c = getASTNodeType(type);
    AST t = create(c);
    if ( t!=null ) {
      t.initialize(type, "");
    }
    return t;
  }

  public AST create(int type, String txt) {
View Full Code Here

  }

  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
View Full Code Here

   @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
View Full Code Here

     */
    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) {
View Full Code Here

    }

  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
View Full Code Here

      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);
View Full Code Here

    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) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.