Examples of ASTPair


Examples of antlr.ASTPair

  }
 
  public final void genericMethod() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST genericMethod_AST = null;
    AST m_AST = null;
    AST p_AST = null;
    AST t_AST = null;
    AST v_AST = null;
   
    modifiers();
    m_AST = (AST)returnAST;
    typeParameters();
    p_AST = (AST)returnAST;
    typeSpec(false);
    t_AST = (AST)returnAST;
    variableDefinitions(m_AST, t_AST);
    v_AST = (AST)returnAST;
    if ( inputState.guessing==0 ) {
      genericMethod_AST = (AST)currentAST.root;
     
      genericMethod_AST = v_AST;
      AST old = v_AST.getFirstChild();
      genericMethod_AST.setFirstChild(p_AST);
      p_AST.setNextSibling(old);
     
      currentAST.root = genericMethod_AST;
      currentAST.child = genericMethod_AST!=null &&genericMethod_AST.getFirstChild()!=null ?
        genericMethod_AST.getFirstChild() : genericMethod_AST;
      currentAST.advanceChildToEnd();
    }
    returnAST = genericMethod_AST;
  }
View Full Code Here

Examples of antlr.ASTPair

  }
 
  public final void typeParameters() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST typeParameters_AST = null;
    Token first = LT(1);int currentLtLevel = 0;
   
    if ( inputState.guessing==0 ) {
      currentLtLevel = ltCounter;
    }
    match(LT);
    if ( inputState.guessing==0 ) {
      ltCounter++;
    }
    nls();
    typeParameter();
    astFactory.addASTChild(currentAST, returnAST);
    {
    _loop110:
    do {
      if ((LA(1)==COMMA)) {
        match(COMMA);
        nls();
        typeParameter();
        astFactory.addASTChild(currentAST, returnAST);
      }
      else {
        break _loop110;
      }
     
    } while (true);
    }
    nls();
    {
    switch ( LA(1)) {
    case GT:
    case SR:
    case BSR:
    {
      typeArgumentsOrParametersEnd();
      astFactory.addASTChild(currentAST, returnAST);
      break;
    }
    case IDENT:
    case LITERAL_extends:
    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 LCURLY:
    case LITERAL_implements:
    case NLS:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if (!(matchGenericTypeBrackets(((currentLtLevel != 0) || ltCounter == currentLtLevel),
        "Missing closing bracket '>' for generics types", "Please specify the missing bracket!")))
      throw new SemanticException("matchGenericTypeBrackets(((currentLtLevel != 0) || ltCounter == currentLtLevel),\n        \"Missing closing bracket '>' for generics types\", \"Please specify the missing bracket!\")");
    if ( inputState.guessing==0 ) {
      typeParameters_AST = (AST)currentAST.root;
      typeParameters_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_PARAMETERS,"TYPE_PARAMETERS",first,LT(1))).add(typeParameters_AST));
      currentAST.root = typeParameters_AST;
      currentAST.child = typeParameters_AST!=null &&typeParameters_AST.getFirstChild()!=null ?
        typeParameters_AST.getFirstChild() : typeParameters_AST;
      currentAST.advanceChildToEnd();
    }
    typeParameters_AST = (AST)currentAST.root;
    returnAST = typeParameters_AST;
  }
View Full Code Here

Examples of antlr.ASTPair

*  Used to parse loops like <code>for (int x in y)</code> (up to the <code>in</code> keyword).
*/
  public final void singleDeclarationNoInit() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST singleDeclarationNoInit_AST = null;
    AST m_AST = null;
    AST t_AST = null;
    AST v_AST = null;
    AST t2_AST = null;
    AST v2_AST = null;
   
    switch ( LA(1)) {
    case FINAL:
    case ABSTRACT:
    case STRICTFP:
    case LITERAL_static:
    case LITERAL_def:
    case AT:
    case LITERAL_private:
    case LITERAL_public:
    case LITERAL_protected:
    case LITERAL_transient:
    case LITERAL_native:
    case LITERAL_threadsafe:
    case LITERAL_synchronized:
    case LITERAL_volatile:
    {
      modifiers();
      m_AST = (AST)returnAST;
      {
      if ((_tokenSet_24.member(LA(1))) && (_tokenSet_31.member(LA(2)))) {
        typeSpec(false);
        t_AST = (AST)returnAST;
      }
      else if ((LA(1)==IDENT) && (_tokenSet_32.member(LA(2)))) {
      }
      else {
        throw new NoViableAltException(LT(1), getFilename());
      }
     
      }
      singleVariable(m_AST, t_AST);
      v_AST = (AST)returnAST;
      if ( inputState.guessing==0 ) {
        singleDeclarationNoInit_AST = (AST)currentAST.root;
        singleDeclarationNoInit_AST = v_AST;
        currentAST.root = singleDeclarationNoInit_AST;
        currentAST.child = singleDeclarationNoInit_AST!=null &&singleDeclarationNoInit_AST.getFirstChild()!=null ?
          singleDeclarationNoInit_AST.getFirstChild() : singleDeclarationNoInit_AST;
        currentAST.advanceChildToEnd();
      }
      break;
    }
    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:
    {
      typeSpec(false);
      t2_AST = (AST)returnAST;
      singleVariable(null,t2_AST);
      v2_AST = (AST)returnAST;
      if ( inputState.guessing==0 ) {
        singleDeclarationNoInit_AST = (AST)currentAST.root;
        singleDeclarationNoInit_AST = v2_AST;
        currentAST.root = singleDeclarationNoInit_AST;
        currentAST.child = singleDeclarationNoInit_AST!=null &&singleDeclarationNoInit_AST.getFirstChild()!=null ?
          singleDeclarationNoInit_AST.getFirstChild() : singleDeclarationNoInit_AST;
        currentAST.advanceChildToEnd();
      }
      break;
    }
    default:
    {
View Full Code Here

Examples of antlr.ASTPair

  public final void singleVariable(
    AST mods, AST t
  ) throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST singleVariable_AST = null;
    AST id_AST = null;
    Token first = LT(1);
   
    variableName();
    id_AST = (AST)returnAST;
    if ( inputState.guessing==0 ) {
      singleVariable_AST = (AST)currentAST.root;
      singleVariable_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(VARIABLE_DEF,"VARIABLE_DEF",first,LT(1))).add(mods).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t))).add(id_AST));
      currentAST.root = singleVariable_AST;
      currentAST.child = singleVariable_AST!=null &&singleVariable_AST.getFirstChild()!=null ?
        singleVariable_AST.getFirstChild() : singleVariable_AST;
      currentAST.advanceChildToEnd();
    }
    returnAST = singleVariable_AST;
  }
View Full Code Here

Examples of antlr.ASTPair

*  lists and <code>while</code> statements.
*/
  public final void singleDeclaration() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST singleDeclaration_AST = null;
    AST sd_AST = null;
   
    singleDeclarationNoInit();
    sd_AST = (AST)returnAST;
    if ( inputState.guessing==0 ) {
      singleDeclaration_AST = (AST)currentAST.root;
      singleDeclaration_AST = sd_AST;
      currentAST.root = singleDeclaration_AST;
      currentAST.child = singleDeclaration_AST!=null &&singleDeclaration_AST.getFirstChild()!=null ?
        singleDeclaration_AST.getFirstChild() : singleDeclaration_AST;
      currentAST.advanceChildToEnd();
    }
    {
    switch ( LA(1)) {
    case ASSIGN:
    {
View Full Code Here

Examples of antlr.ASTPair

 
/** An assignment operator '=' followed by an expression.  (Never empty.) */
  public final void varInitializer() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST varInitializer_AST = null;
   
    AST tmp41_AST = null;
    tmp41_AST = astFactory.create(LT(1));
    astFactory.makeASTRoot(currentAST, tmp41_AST);
View Full Code Here

Examples of antlr.ASTPair

*  just put a TODO comment in.
*/
  public final void declarationStart() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST declarationStart_AST = null;
   
    {
    int _cnt29=0;
    _loop29:
View Full Code Here

Examples of antlr.ASTPair

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

Examples of antlr.ASTPair

  }
 
  public final void annotation() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST annotation_AST = null;
    AST i_AST = null;
    AST args_AST = null;
    Token first = LT(1);
   
    match(AT);
    identifier();
    i_AST = (AST)returnAST;
    nls();
    {
    if ((LA(1)==LPAREN) && (_tokenSet_35.member(LA(2)))) {
      match(LPAREN);
      {
      switch ( LA(1)) {
      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 IDENT:
      case STRING_LITERAL:
      case LPAREN:
      case LITERAL_class:
      case LITERAL_interface:
      case LITERAL_enum:
      case AT:
      case LITERAL_extends:
      case LITERAL_super:
      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 LCURLY:
      case LITERAL_default:
      case LITERAL_throws:
      case LITERAL_implements:
      case LITERAL_this:
      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 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:
      {
        annotationArguments();
        args_AST = (AST)returnAST;
        break;
      }
      case RPAREN:
      {
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      match(RPAREN);
    }
    else if ((_tokenSet_36.member(LA(1))) && (_tokenSet_37.member(LA(2)))) {
    }
    else {
      throw new NoViableAltException(LT(1), getFilename());
    }
   
    }
    if ( inputState.guessing==0 ) {
      annotation_AST = (AST)currentAST.root;
      annotation_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(ANNOTATION,"ANNOTATION",first,LT(1))).add(i_AST).add(args_AST));
      currentAST.root = annotation_AST;
      currentAST.child = annotation_AST!=null &&annotation_AST.getFirstChild()!=null ?
        annotation_AST.getFirstChild() : annotation_AST;
      currentAST.advanceChildToEnd();
    }
    returnAST = annotation_AST;
  }
View Full Code Here

Examples of antlr.ASTPair

*  In the case of a simple statement {UpperID name} the identifier is taken to be a type name, not a command name.
*/
  public final void upperCaseIdent() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST upperCaseIdent_AST = null;
   
    if (!(isUpperCase(LT(1))))
      throw new SemanticException("isUpperCase(LT(1))");
    AST tmp62_AST = null;
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.