Package tree.expression

Examples of tree.expression.Declaration


            {
                // Haxe.g:141:57: ^( IDENTIFIER ( typeTag )? ( varInit )? ( QUES )? )
                {
                Object root_1 = (Object)adaptor.nil();
                root_1 = (Object)adaptor.becomeRoot(
                new Declaration(stream_IDENTIFIER.nextToken())
                , root_1);

                // Haxe.g:141:83: ( typeTag )?
                if ( stream_typeTag.hasNext() ) {
                    adaptor.addChild(root_1, stream_typeTag.nextTree());
View Full Code Here



                    IDENTIFIER286=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_enumValueDecl4770); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    IDENTIFIER286_tree =
                    new Declaration(IDENTIFIER286)
                    ;
                    root_0 = (Object)adaptor.becomeRoot(IDENTIFIER286_tree, root_0);
                    }

                    LPAREN287=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_enumValueDecl4776); if (state.failed) return retval;

                    // Haxe.g:383:52: ( paramList )?
                    int alt83=2;
                    int LA83_0 = input.LA(1);

                    if ( (LA83_0==IDENTIFIER||LA83_0==QUES) ) {
                        alt83=1;
                    }
                    switch (alt83) {
                        case 1 :
                            // Haxe.g:383:52: paramList
                            {
                            pushFollow(FOLLOW_paramList_in_enumValueDecl4779);
                            paramList288=paramList();

                            state._fsp--;
                            if (state.failed) return retval;
                            if ( state.backtracking==0 ) adaptor.addChild(root_0, paramList288.getTree());

                            }
                            break;

                    }


                    RPAREN289=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_enumValueDecl4782); if (state.failed) return retval;

                    SEMI290=(Token)match(input,SEMI,FOLLOW_SEMI_in_enumValueDecl4785); if (state.failed) return retval;

                    }
                    break;
                case 2 :
                    // Haxe.g:384:19: IDENTIFIER SEMI !
                    {
                    root_0 = (Object)adaptor.nil();


                    IDENTIFIER291=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_enumValueDecl4808); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    IDENTIFIER291_tree =
                    new Declaration(IDENTIFIER291)
                    ;
                    adaptor.addChild(root_0, IDENTIFIER291_tree);
                    }

                    SEMI292=(Token)match(input,SEMI,FOLLOW_SEMI_in_enumValueDecl4813); if (state.failed) return retval;
View Full Code Here

            }

            IDENTIFIER309=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_varDeclClass5080); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            IDENTIFIER309_tree =
            new Declaration(IDENTIFIER309)
            ;
            root_0 = (Object)adaptor.becomeRoot(IDENTIFIER309_tree, root_0);
            }

            // Haxe.g:400:62: ( propDecl )?
View Full Code Here

            {
                // Haxe.g:406:61: ^( IDENTIFIER ( propDecl )? ( typeTag )? ( varInit )? )
                {
                Object root_1 = (Object)adaptor.nil();
                root_1 = (Object)adaptor.becomeRoot(
                new Declaration(stream_IDENTIFIER.nextToken())
                , root_1);

                // Haxe.g:406:87: ( propDecl )?
                if ( stream_propDecl.hasNext() ) {
                    adaptor.addChild(root_1, stream_propDecl.nextTree());
View Full Code Here

      final Environment availableVars,
      final String prefix, final int offset) {

    Set<ComparableSourceProposal> result = new TreeSet<ComparableSourceProposal>();
    for (HaxeTree commonTree : availableVars.values()) {
      Declaration usage = (Declaration) commonTree;
      result.add(new ComparableSourceProposal(
              usage.getHaxeType().toString(),
          usage.getText(), prefix, offset));
    }
    return result.toArray(new SourceProposal[0]);
  }
View Full Code Here

            Function hdr = (Function) n;
            return hdr.getFullNameWithParameters();
        }
        if (n instanceof Declaration)
        {
            Declaration varDeclaration = (Declaration) n;
            return varDeclaration.getText();
        }       
        if (n instanceof Usage)
        {
            HaxeTree decl = ((Usage)n).getDeclarationNode();
            if (decl instanceof Declaration)
View Full Code Here

   
    @Test
    public void parseDeclarationListFields() throws RecognitionException
    {
        HaxeTree tree = parseStatement("var x,c : Int = 5;");
        Declaration firstDecl = (Declaration)tree.getChild(0);
        Declaration secondDecl = (Declaration)tree.getChild(1);
        firstDecl.updateInfo();
        secondDecl.updateInfo();
       
        HaxeType intType = TypeUtils.getInt();
        assertTrue(!firstDecl.getHaxeType().equals(secondDecl.getHaxeType()));
        assertTrue(secondDecl.getHaxeType().equals(intType));
        assertTrue(!firstDecl.getHaxeType().equals(intType));
       
        assertTrue(secondDecl.getChild(secondDecl.getChildCount()-1).getChild(0) instanceof Constant);
    }
View Full Code Here

TOP

Related Classes of tree.expression.Declaration

Copyright © 2018 www.massapicom. 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.