Examples of ASTPair


Examples of antlr.ASTPair

  public final void classOrInterfaceType(
    boolean addImagNode
  ) throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST classOrInterfaceType_AST = null;
    Token  i1 = null;
    AST i1_AST = null;
    Token  d = null;
    AST d_AST = null;
    Token  i2 = null;
    AST i2_AST = null;
    AST ta_AST = null;
    Token first = LT(1);
   
    i1 = LT(1);
    i1_AST = astFactory.create(i1);
    astFactory.makeASTRoot(currentAST, i1_AST);
    match(IDENT);
    {
    if ((LA(1)==LT) && (_tokenSet_38.member(LA(2)))) {
      typeArguments();
      astFactory.addASTChild(currentAST, returnAST);
    }
    else if ((LA(1)==LT) && (LA(2)==GT)) {
      typeArgumentsDiamond();
      astFactory.addASTChild(currentAST, returnAST);
    }
    else if ((_tokenSet_40.member(LA(1)))) {
    }
    else {
      throw new NoViableAltException(LT(1), getFilename());
    }
   
    }
    {
    _loop47:
    do {
      if ((LA(1)==DOT) && (LA(2)==IDENT)) {
        d = LT(1);
        d_AST = astFactory.create(d);
        match(DOT);
        i2 = LT(1);
        i2_AST = astFactory.create(i2);
        match(IDENT);
        {
        switch ( LA(1)) {
        case LT:
        {
          typeArguments();
          ta_AST = (AST)returnAST;
          break;
        }
        case EOF:
        case FINAL:
        case ABSTRACT:
        case UNUSED_GOTO:
        case UNUSED_CONST:
        case UNUSED_DO:
        case STRICTFP:
        case LITERAL_package:
        case LITERAL_import:
        case LITERAL_static:
        case LITERAL_def:
        case LBRACK:
        case RBRACK:
        case IDENT:
        case STRING_LITERAL:
        case DOT:
        case LPAREN:
        case LITERAL_class:
        case LITERAL_interface:
        case LITERAL_enum:
        case AT:
        case QUESTION:
        case LITERAL_extends:
        case LITERAL_super:
        case GT:
        case COMMA:
        case SR:
        case BSR:
        case LITERAL_void:
        case LITERAL_boolean:
        case LITERAL_byte:
        case LITERAL_char:
        case LITERAL_short:
        case LITERAL_int:
        case LITERAL_float:
        case LITERAL_long:
        case LITERAL_double:
        case LITERAL_as:
        case LITERAL_private:
        case LITERAL_public:
        case LITERAL_protected:
        case LITERAL_transient:
        case LITERAL_native:
        case LITERAL_threadsafe:
        case LITERAL_synchronized:
        case LITERAL_volatile:
        case RPAREN:
        case ASSIGN:
        case BAND:
        case LCURLY:
        case RCURLY:
        case SEMI:
        case LITERAL_default:
        case LITERAL_throws:
        case LITERAL_implements:
        case LITERAL_this:
        case TRIPLE_DOT:
        case CLOSABLE_BLOCK_OP:
        case COLON:
        case LITERAL_if:
        case LITERAL_else:
        case LITERAL_while:
        case LITERAL_switch:
        case LITERAL_for:
        case LITERAL_in:
        case LITERAL_return:
        case LITERAL_break:
        case LITERAL_continue:
        case LITERAL_throw:
        case LITERAL_assert:
        case PLUS:
        case MINUS:
        case LITERAL_case:
        case LITERAL_try:
        case LITERAL_finally:
        case LITERAL_catch:
        case LITERAL_false:
        case LITERAL_instanceof:
        case LITERAL_new:
        case LITERAL_null:
        case LITERAL_true:
        case PLUS_ASSIGN:
        case MINUS_ASSIGN:
        case STAR_ASSIGN:
        case DIV_ASSIGN:
        case MOD_ASSIGN:
        case SR_ASSIGN:
        case BSR_ASSIGN:
        case SL_ASSIGN:
        case BAND_ASSIGN:
        case BXOR_ASSIGN:
        case BOR_ASSIGN:
        case STAR_STAR_ASSIGN:
        case ELVIS_OPERATOR:
        case LOR:
        case LAND:
        case BOR:
        case BXOR:
        case REGEX_FIND:
        case REGEX_MATCH:
        case NOT_EQUAL:
        case EQUAL:
        case IDENTICAL:
        case NOT_IDENTICAL:
        case COMPARE_TO:
        case INC:
        case DEC:
        case BNOT:
        case LNOT:
        case STRING_CTOR_START:
        case NUM_INT:
        case NUM_FLOAT:
        case NUM_LONG:
        case NUM_DOUBLE:
        case NUM_BIG_INT:
        case NUM_BIG_DECIMAL:
        case NLS:
        {
          break;
        }
        default:
        {
          throw new NoViableAltException(LT(1), getFilename());
        }
        }
        }
        if ( inputState.guessing==0 ) {
          i1_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(DOT,".",first,LT(1))).add(i1_AST).add(i2_AST).add(ta_AST));
        }
      }
      else {
        break _loop47;
      }
     
    } while (true);
    }
    if ( inputState.guessing==0 ) {
      classOrInterfaceType_AST = (AST)currentAST.root;
     
      classOrInterfaceType_AST = i1_AST;
      if ( addImagNode ) {
      classOrInterfaceType_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(classOrInterfaceType_AST));
      }
     
      currentAST.root = classOrInterfaceType_AST;
      currentAST.child = classOrInterfaceType_AST!=null &&classOrInterfaceType_AST.getFirstChild()!=null ?
        classOrInterfaceType_AST.getFirstChild() : classOrInterfaceType_AST;
      currentAST.advanceChildToEnd();
    }
    classOrInterfaceType_AST = (AST)currentAST.root;
    returnAST = classOrInterfaceType_AST;
  }
View Full Code Here

Examples of antlr.ASTPair

  public final void declaratorBrackets(
    AST typ
  ) throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST declaratorBrackets_AST = null;
   
    if ( inputState.guessing==0 ) {
      declaratorBrackets_AST = (AST)currentAST.root;
      declaratorBrackets_AST=typ;
      currentAST.root = declaratorBrackets_AST;
      currentAST.child = declaratorBrackets_AST!=null &&declaratorBrackets_AST.getFirstChild()!=null ?
        declaratorBrackets_AST.getFirstChild() : declaratorBrackets_AST;
      currentAST.advanceChildToEnd();
    }
    {
    _loop248:
    do {
      if ((LA(1)==LBRACK) && (LA(2)==RBRACK)) {
        match(LBRACK);
        match(RBRACK);
        if ( inputState.guessing==0 ) {
          declaratorBrackets_AST = (AST)currentAST.root;
          declaratorBrackets_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(ARRAY_DECLARATOR,"[",typ,LT(1))).add(declaratorBrackets_AST));
          currentAST.root = declaratorBrackets_AST;
          currentAST.child = declaratorBrackets_AST!=null &&declaratorBrackets_AST.getFirstChild()!=null ?
            declaratorBrackets_AST.getFirstChild() : declaratorBrackets_AST;
          currentAST.advanceChildToEnd();
        }
      }
      else {
        break _loop248;
      }
View Full Code Here

Examples of antlr.ASTPair

  }
 
  public final void typeArgumentsDiamond() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST typeArgumentsDiamond_AST = null;
    Token first = LT(1);
   
    match(LT);
    match(GT);
View Full Code Here

Examples of antlr.ASTPair

  }
 
  public final void typeArgumentSpec() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST typeArgumentSpec_AST = null;
   
    switch ( LA(1)) {
    case IDENT:
    {
View Full Code Here

Examples of antlr.ASTPair

  public final void builtInTypeArraySpec(
    boolean addImagNode
  ) throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST builtInTypeArraySpec_AST = null;
    AST bt_AST = null;
    Token first = LT(1);
   
    builtInType();
    bt_AST = (AST)returnAST;
    {
    boolean synPredMatched66 = false;
    if (((_tokenSet_40.member(LA(1))) && (_tokenSet_3.member(LA(2))))) {
      int _m66 = mark();
      synPredMatched66 = true;
      inputState.guessing++;
      try {
        {
        match(LBRACK);
        }
      }
      catch (RecognitionException pe) {
        synPredMatched66 = false;
      }
      rewind(_m66);
inputState.guessing--;
    }
    if ( synPredMatched66 ) {
      declaratorBrackets(bt_AST);
      astFactory.addASTChild(currentAST, returnAST);
    }
    else if ((_tokenSet_40.member(LA(1))) && (_tokenSet_3.member(LA(2)))) {
      if ( inputState.guessing==0 ) {
        require(false,
        "primitive type parameters not allowed here",
        "use the corresponding wrapper type, such as Integer for int"
        );
      }
    }
    else {
      throw new NoViableAltException(LT(1), getFilename());
    }
   
    }
    if ( inputState.guessing==0 ) {
      builtInTypeArraySpec_AST = (AST)currentAST.root;
     
      if ( addImagNode ) {
      builtInTypeArraySpec_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(builtInTypeArraySpec_AST));
      }
     
      currentAST.root = builtInTypeArraySpec_AST;
      currentAST.child = builtInTypeArraySpec_AST!=null &&builtInTypeArraySpec_AST.getFirstChild()!=null ?
        builtInTypeArraySpec_AST.getFirstChild() : builtInTypeArraySpec_AST;
      currentAST.advanceChildToEnd();
    }
    builtInTypeArraySpec_AST = (AST)currentAST.root;
    returnAST = builtInTypeArraySpec_AST;
  }
View Full Code Here

Examples of antlr.ASTPair

  }
 
  public final void typeArgument() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST typeArgument_AST = null;
    Token first = LT(1);
   
    {
    switch ( LA(1)) {
    case IDENT:
    case LITERAL_void:
    case LITERAL_boolean:
    case LITERAL_byte:
    case LITERAL_char:
    case LITERAL_short:
    case LITERAL_int:
    case LITERAL_float:
    case LITERAL_long:
    case LITERAL_double:
    {
      typeArgumentSpec();
      astFactory.addASTChild(currentAST, returnAST);
      break;
    }
    case QUESTION:
    {
      wildcardType();
      astFactory.addASTChild(currentAST, returnAST);
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if ( inputState.guessing==0 ) {
      typeArgument_AST = (AST)currentAST.root;
      typeArgument_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_ARGUMENT,"TYPE_ARGUMENT",first,LT(1))).add(typeArgument_AST));
      currentAST.root = typeArgument_AST;
      currentAST.child = typeArgument_AST!=null &&typeArgument_AST.getFirstChild()!=null ?
        typeArgument_AST.getFirstChild() : typeArgument_AST;
      currentAST.advanceChildToEnd();
    }
    typeArgument_AST = (AST)currentAST.root;
    returnAST = typeArgument_AST;
  }
View Full Code Here

Examples of antlr.ASTPair

  }
 
  public final void wildcardType() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST wildcardType_AST = null;
   
    AST tmp91_AST = null;
    tmp91_AST = astFactory.create(LT(1));
    astFactory.addASTChild(currentAST, tmp91_AST);
View Full Code Here

Examples of antlr.ASTPair

  }
 
  public final void typeArgumentBounds() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST typeArgumentBounds_AST = null;
    Token first = LT(1);boolean isUpperBounds = false;
   
    {
    switch ( LA(1)) {
    case LITERAL_extends:
    {
      match(LITERAL_extends);
      if ( inputState.guessing==0 ) {
        isUpperBounds=true;
      }
      break;
    }
    case LITERAL_super:
    {
      match(LITERAL_super);
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    nls();
    classOrInterfaceType(true);
    astFactory.addASTChild(currentAST, returnAST);
    nls();
    if ( inputState.guessing==0 ) {
      typeArgumentBounds_AST = (AST)currentAST.root;
     
      if (isUpperBounds)
      {
      typeArgumentBounds_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_UPPER_BOUNDS,"TYPE_UPPER_BOUNDS",first,LT(1))).add(typeArgumentBounds_AST));
      }
      else
      {
      typeArgumentBounds_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_LOWER_BOUNDS,"TYPE_LOWER_BOUNDS",first,LT(1))).add(typeArgumentBounds_AST));
      }
     
      currentAST.root = typeArgumentBounds_AST;
      currentAST.child = typeArgumentBounds_AST!=null &&typeArgumentBounds_AST.getFirstChild()!=null ?
        typeArgumentBounds_AST.getFirstChild() : typeArgumentBounds_AST;
      currentAST.advanceChildToEnd();
    }
    typeArgumentBounds_AST = (AST)currentAST.root;
    returnAST = typeArgumentBounds_AST;
  }
View Full Code Here

Examples of antlr.ASTPair

  }
 
  protected final void typeArgumentsOrParametersEnd() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST typeArgumentsOrParametersEnd_AST = null;
   
    switch ( LA(1)) {
    case GT:
    {
View Full Code Here

Examples of antlr.ASTPair

  }
 
  public final void type() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST type_AST = null;
   
    switch ( LA(1)) {
    case IDENT:
    {
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.