Examples of EnumDeclarationDescrBuilder


Examples of org.drools.compiler.lang.api.EnumDeclarationDescrBuilder

     *
     * @return
     * @throws RecognitionException
     */
    public EnumDeclarationDescr enumDeclaration(DeclareDescrBuilder ddb) throws RecognitionException {
        EnumDeclarationDescrBuilder declare = null;
        try {
            declare = helper.start(ddb,
                    EnumDeclarationDescrBuilder.class,
                    null);

            // type may be qualified when adding metadata
            String type = qualifiedIdentifier();
            if (state.failed)
                return null;
            if (state.backtracking == 0)
                declare.name(type);

            while (input.LA(1) == DRL6Lexer.AT) {
                // annotation*
                annotation(declare);
                if (state.failed)
                    return null;
            }

            while (input.LA(1) == DRL6Lexer.ID) {
                int next = input.LA(2);
                if (next == DRL6Lexer.LEFT_PAREN || next == DRL6Lexer.COMMA || next == DRL6Lexer.SEMICOLON) {
                    enumerative(declare);
                    if (state.failed)
                        return null;
                }

                if (input.LA(1) == DRL6Lexer.COMMA) {
                    match(input,
                            DRL6Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                } else {
                    match(input,
                            DRL6Lexer.SEMICOLON,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    break;
                }
            }

            //boolean qualified = type.indexOf( '.' ) >= 0;
            while ( //! qualified &&
            input.LA(1) == DRL6Lexer.ID && !helper.validateIdentifierKey(DroolsSoftKeywords.END)) {
                // field*
                field(declare);
                if (state.failed)
                    return null;
            }

            match(input,
                    DRL6Lexer.ID,
                    DroolsSoftKeywords.END,
                    null,
                    DroolsEditorType.KEYWORD);

            if (state.failed)
                return null;

        } catch (RecognitionException re) {
            reportError(re);
        } finally {
            helper.end(TypeDeclarationDescrBuilder.class,
                    declare);
        }
        return (declare != null) ? declare.getDescr() : null;
    }
View Full Code Here

Examples of org.drools.compiler.lang.api.EnumDeclarationDescrBuilder

     *
     * @return
     * @throws RecognitionException
     */
    public EnumDeclarationDescr enumDeclaration( DeclareDescrBuilder ddb ) throws RecognitionException {
        EnumDeclarationDescrBuilder declare = null;
        try {
            declare = helper.start( ddb,
                    EnumDeclarationDescrBuilder.class,
                    null );

            // type may be qualified when adding metadata
            String type = qualifiedIdentifier();
            if ( state.failed ) return null;
            if ( state.backtracking == 0 ) declare.name( type );

            while ( input.LA( 1 ) == DRL6Lexer.AT ) {
                // annotation*
                annotation( declare );
                if ( state.failed ) return null;
            }

            while ( input.LA( 1 ) == DRL6Lexer.ID ) {
                int next = input.LA( 2 );
                if ( next == DRL6Lexer.LEFT_PAREN || next == DRL6Lexer.COMMA || next == DRL6Lexer.SEMICOLON ) {
                    enumerative( declare );
                    if ( state.failed ) return null;
                }

                if ( input.LA( 1 ) == DRL6Lexer.COMMA ) {
                    match( input,
                            DRL6Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL );
                } else {
                    match( input,
                            DRL6Lexer.SEMICOLON,
                            null,
                            null,
                            DroolsEditorType.SYMBOL );
                    break;
                }
            }

            //boolean qualified = type.indexOf( '.' ) >= 0;
            while ( //! qualified &&
                    input.LA( 1 ) == DRL6Lexer.ID && ! helper.validateIdentifierKey( DroolsSoftKeywords.END ) ) {
                // field*
                field( declare );
                if ( state.failed ) return null;
            }

            match( input,
                    DRL6Lexer.ID,
                    DroolsSoftKeywords.END,
                    null,
                    DroolsEditorType.KEYWORD );

            if ( state.failed ) return null;

        } catch ( RecognitionException re ) {
            reportError( re );
        } finally {
            helper.end( TypeDeclarationDescrBuilder.class,
                    declare );
        }
        return (declare != null) ? declare.getDescr() : null;
    }
View Full Code Here

Examples of org.drools.compiler.lang.api.EnumDeclarationDescrBuilder

     *
     * @return
     * @throws RecognitionException
     */
    public EnumDeclarationDescr enumDeclaration( DeclareDescrBuilder ddb ) throws RecognitionException {
        EnumDeclarationDescrBuilder declare = null;
        try {
            declare = helper.start( ddb,
                    EnumDeclarationDescrBuilder.class,
                    null );

            // type may be qualified when adding metadata
            String type = qualifiedIdentifier();
            if ( state.failed ) return null;
            if ( state.backtracking == 0 ) declare.name( type );

            while ( input.LA( 1 ) == DRL5Lexer.AT ) {
                // annotation*
                annotation( declare );
                if ( state.failed ) return null;
            }

            while ( input.LA( 1 ) == DRL5Lexer.ID ) {
                int next = input.LA( 2 );
                if ( next == DRL5Lexer.LEFT_PAREN || next == DRL5Lexer.COMMA || next == DRL5Lexer.SEMICOLON ) {
                    enumerative( declare );
                    if ( state.failed ) return null;
                }
               
                if ( input.LA( 1 ) == DRL5Lexer.COMMA ) {
                    match( input,
                            DRL5Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL );
                } else {
                    match( input,
                            DRL5Lexer.SEMICOLON,
                            null,
                            null,
                            DroolsEditorType.SYMBOL );
                    break;
                }
            }

            //boolean qualified = type.indexOf( '.' ) >= 0;
            while ( //! qualified &&
                    input.LA( 1 ) == DRL5Lexer.ID && ! helper.validateIdentifierKey( DroolsSoftKeywords.END ) ) {
                // field*
                field( declare );
                if ( state.failed ) return null;
            }

            match( input,
                    DRL5Lexer.ID,
                    DroolsSoftKeywords.END,
                    null,
                    DroolsEditorType.KEYWORD );

            if ( state.failed ) return null;

        } catch ( RecognitionException re ) {
            reportError( re );
        } finally {
            helper.end( TypeDeclarationDescrBuilder.class,
                    declare );
        }
        return (declare != null) ? declare.getDescr() : null;
    }
View Full Code Here

Examples of org.drools.compiler.lang.api.EnumDeclarationDescrBuilder

     *
     * @return
     * @throws RecognitionException
     */
    public EnumDeclarationDescr enumDeclaration( DeclareDescrBuilder ddb ) throws RecognitionException {
        EnumDeclarationDescrBuilder declare = null;
        try {
            declare = helper.start( ddb,
                    EnumDeclarationDescrBuilder.class,
                    null );

            // type may be qualified when adding metadata
            String type = qualifiedIdentifier();
            if ( state.failed ) return null;
            if ( state.backtracking == 0 ) declare.name( type );

            while ( input.LA( 1 ) == DRL6Lexer.AT ) {
                // annotation*
                annotation( declare );
                if ( state.failed ) return null;
            }

            while ( input.LA( 1 ) == DRL6Lexer.ID ) {
                int next = input.LA( 2 );
                if ( next == DRL6Lexer.LEFT_PAREN || next == DRL6Lexer.COMMA || next == DRL6Lexer.SEMICOLON ) {
                    enumerative( declare );
                    if ( state.failed ) return null;
                }

                if ( input.LA( 1 ) == DRL6Lexer.COMMA ) {
                    match( input,
                            DRL6Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL );
                } else {
                    match( input,
                            DRL6Lexer.SEMICOLON,
                            null,
                            null,
                            DroolsEditorType.SYMBOL );
                    break;
                }
            }

            //boolean qualified = type.indexOf( '.' ) >= 0;
            while ( //! qualified &&
                    input.LA( 1 ) == DRL6Lexer.ID && ! helper.validateIdentifierKey( DroolsSoftKeywords.END ) ) {
                // field*
                field( declare );
                if ( state.failed ) return null;
            }

            match( input,
                    DRL6Lexer.ID,
                    DroolsSoftKeywords.END,
                    null,
                    DroolsEditorType.KEYWORD );

            if ( state.failed ) return null;

        } catch ( RecognitionException re ) {
            reportError( re );
        } finally {
            helper.end( TypeDeclarationDescrBuilder.class,
                    declare );
        }
        return (declare != null) ? declare.getDescr() : null;
    }
View Full Code Here

Examples of org.drools.compiler.lang.api.EnumDeclarationDescrBuilder

     *
     * @return
     * @throws RecognitionException
     */
    public EnumDeclarationDescr enumDeclaration(DeclareDescrBuilder ddb) throws RecognitionException {
        EnumDeclarationDescrBuilder declare = null;
        try {
            declare = helper.start(ddb,
                    EnumDeclarationDescrBuilder.class,
                    null);

            // type may be qualified when adding metadata
            String type = qualifiedIdentifier();
            if (state.failed)
                return null;
            if (state.backtracking == 0)
                declare.name(type);

            while (input.LA(1) == DRL6Lexer.AT) {
                // annotation*
                annotation(declare);
                if (state.failed)
                    return null;
            }

            while (input.LA(1) == DRL6Lexer.ID) {
                int next = input.LA(2);
                if (next == DRL6Lexer.LEFT_PAREN || next == DRL6Lexer.COMMA || next == DRL6Lexer.SEMICOLON) {
                    enumerative(declare);
                    if (state.failed)
                        return null;
                }

                if (input.LA(1) == DRL6Lexer.COMMA) {
                    match(input,
                            DRL6Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                } else {
                    match(input,
                            DRL6Lexer.SEMICOLON,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    break;
                }
            }

            //boolean qualified = type.indexOf( '.' ) >= 0;
            while ( //! qualified &&
            input.LA(1) == DRL6Lexer.ID && !helper.validateIdentifierKey(DroolsSoftKeywords.END)) {
                // field*
                field(declare);
                if (state.failed)
                    return null;
            }

            match(input,
                    DRL6Lexer.ID,
                    DroolsSoftKeywords.END,
                    null,
                    DroolsEditorType.KEYWORD);

            if (state.failed)
                return null;

        } catch (RecognitionException re) {
            reportError(re);
        } finally {
            helper.end(TypeDeclarationDescrBuilder.class,
                    declare);
        }
        return (declare != null) ? declare.getDescr() : null;
    }
View Full Code Here

Examples of org.drools.compiler.lang.api.EnumDeclarationDescrBuilder

     *
     * @return
     * @throws RecognitionException
     */
    public EnumDeclarationDescr enumDeclaration( DeclareDescrBuilder ddb ) throws RecognitionException {
        EnumDeclarationDescrBuilder declare = null;
        try {
            declare = helper.start( ddb,
                    EnumDeclarationDescrBuilder.class,
                    null );

            // type may be qualified when adding metadata
            String type = qualifiedIdentifier();
            if ( state.failed ) return null;
            if ( state.backtracking == 0 ) declare.name( type );

            while ( input.LA( 1 ) == DRL5Lexer.AT ) {
                // annotation*
                annotation( declare );
                if ( state.failed ) return null;
            }

            while ( input.LA( 1 ) == DRL5Lexer.ID ) {
                int next = input.LA( 2 );
                if ( next == DRL5Lexer.LEFT_PAREN || next == DRL5Lexer.COMMA || next == DRL5Lexer.SEMICOLON ) {
                    enumerative( declare );
                    if ( state.failed ) return null;
                }
               
                if ( input.LA( 1 ) == DRL5Lexer.COMMA ) {
                    match( input,
                            DRL5Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL );
                } else {
                    match( input,
                            DRL5Lexer.SEMICOLON,
                            null,
                            null,
                            DroolsEditorType.SYMBOL );
                    break;
                }
            }

            //boolean qualified = type.indexOf( '.' ) >= 0;
            while ( //! qualified &&
                    input.LA( 1 ) == DRL5Lexer.ID && ! helper.validateIdentifierKey( DroolsSoftKeywords.END ) ) {
                // field*
                field( declare );
                if ( state.failed ) return null;
            }

            match( input,
                    DRL5Lexer.ID,
                    DroolsSoftKeywords.END,
                    null,
                    DroolsEditorType.KEYWORD );

            if ( state.failed ) return null;

        } catch ( RecognitionException re ) {
            reportError( re );
        } finally {
            helper.end( TypeDeclarationDescrBuilder.class,
                    declare );
        }
        return (declare != null) ? declare.getDescr() : null;
    }
View Full Code Here

Examples of org.drools.compiler.lang.api.EnumDeclarationDescrBuilder

     *
     * @return
     * @throws RecognitionException
     */
    public EnumDeclarationDescr enumDeclaration(DeclareDescrBuilder ddb) throws RecognitionException {
        EnumDeclarationDescrBuilder declare = null;
        try {
            declare = helper.start(ddb,
                    EnumDeclarationDescrBuilder.class,
                    null);

            setAnnotationsOn(declare);

            // type may be qualified when adding metadata
            String type = qualifiedIdentifier();
            if (state.failed)
                return null;
            if (state.backtracking == 0)
                declare.name(type);

            while (input.LA(1) == DRL6Lexer.ID) {
                int next = input.LA(2);
                if (next == DRL6Lexer.LEFT_PAREN || next == DRL6Lexer.COMMA || next == DRL6Lexer.SEMICOLON) {
                    enumerative(declare);
                    if (state.failed)
                        return null;
                }

                if (input.LA(1) == DRL6Lexer.COMMA) {
                    match(input,
                            DRL6Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                } else {
                    match(input,
                            DRL6Lexer.SEMICOLON,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    break;
                }
            }

            //boolean qualified = type.indexOf( '.' ) >= 0;
            while ( //! qualified &&
            input.LA(1) == DRL6Lexer.ID && !helper.validateIdentifierKey(DroolsSoftKeywords.END)) {
                // field*
                field(declare);
                if (state.failed)
                    return null;
            }

            match(input,
                    DRL6Lexer.ID,
                    DroolsSoftKeywords.END,
                    null,
                    DroolsEditorType.KEYWORD);

            if (state.failed)
                return null;

        } catch (RecognitionException re) {
            reportError(re);
        } finally {
            helper.end(TypeDeclarationDescrBuilder.class,
                    declare);
        }
        return (declare != null) ? declare.getDescr() : null;
    }
View Full Code Here

Examples of org.drools.compiler.lang.api.EnumDeclarationDescrBuilder

                pushParaphrases( DroolsParaphraseTypes.TYPE_DECLARE );
                beginSentence( DroolsSentenceType.TYPE_DECLARATION );
                setStart( declare );
                return (T) declare;
            } else if ( EnumDeclarationDescrBuilder.class.isAssignableFrom( clazz ) ) {
                EnumDeclarationDescrBuilder declare = ctxBuilder == null ?
                        DescrFactory.newPackage().newDeclare().enumerative() :
                        ((DeclareDescrBuilder) ctxBuilder).enumerative();
                pushParaphrases( DroolsParaphraseTypes.ENUM_DECLARE );
                beginSentence( DroolsSentenceType.ENUM_DECLARATION );
                setStart( declare );
View Full Code Here

Examples of org.drools.compiler.lang.api.EnumDeclarationDescrBuilder

     *
     * @return
     * @throws RecognitionException
     */
    public EnumDeclarationDescr enumDeclaration(DeclareDescrBuilder ddb) throws RecognitionException {
        EnumDeclarationDescrBuilder declare = null;
        try {
            declare = helper.start(ddb,
                    EnumDeclarationDescrBuilder.class,
                    null);

            // type may be qualified when adding metadata
            String type = qualifiedIdentifier();
            if (state.failed)
                return null;
            if (state.backtracking == 0)
                declare.name(type);

            while (input.LA(1) == DRL6Lexer.AT) {
                // annotation*
                annotation(declare);
                if (state.failed)
                    return null;
            }

            while (input.LA(1) == DRL6Lexer.ID) {
                int next = input.LA(2);
                if (next == DRL6Lexer.LEFT_PAREN || next == DRL6Lexer.COMMA || next == DRL6Lexer.SEMICOLON) {
                    enumerative(declare);
                    if (state.failed)
                        return null;
                }

                if (input.LA(1) == DRL6Lexer.COMMA) {
                    match(input,
                            DRL6Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                } else {
                    match(input,
                            DRL6Lexer.SEMICOLON,
                            null,
                            null,
                            DroolsEditorType.SYMBOL);
                    break;
                }
            }

            //boolean qualified = type.indexOf( '.' ) >= 0;
            while ( //! qualified &&
            input.LA(1) == DRL6Lexer.ID && !helper.validateIdentifierKey(DroolsSoftKeywords.END)) {
                // field*
                field(declare);
                if (state.failed)
                    return null;
            }

            match(input,
                    DRL6Lexer.ID,
                    DroolsSoftKeywords.END,
                    null,
                    DroolsEditorType.KEYWORD);

            if (state.failed)
                return null;

        } catch (RecognitionException re) {
            reportError(re);
        } finally {
            helper.end(TypeDeclarationDescrBuilder.class,
                    declare);
        }
        return (declare != null) ? declare.getDescr() : null;
    }
View Full Code Here

Examples of org.drools.compiler.lang.api.EnumDeclarationDescrBuilder

     *
     * @return
     * @throws RecognitionException
     */
    public EnumDeclarationDescr enumDeclaration( DeclareDescrBuilder ddb ) throws RecognitionException {
        EnumDeclarationDescrBuilder declare = null;
        try {
            declare = helper.start( ddb,
                    EnumDeclarationDescrBuilder.class,
                    null );

            // type may be qualified when adding metadata
            String type = qualifiedIdentifier();
            if ( state.failed ) return null;
            if ( state.backtracking == 0 ) declare.name( type );

            while ( input.LA( 1 ) == DRL5Lexer.AT ) {
                // annotation*
                annotation( declare );
                if ( state.failed ) return null;
            }

            while ( input.LA( 1 ) == DRL5Lexer.ID ) {
                int next = input.LA( 2 );
                if ( next == DRL5Lexer.LEFT_PAREN || next == DRL5Lexer.COMMA || next == DRL5Lexer.SEMICOLON ) {
                    enumerative( declare );
                    if ( state.failed ) return null;
                }
               
                if ( input.LA( 1 ) == DRL5Lexer.COMMA ) {
                    match( input,
                            DRL5Lexer.COMMA,
                            null,
                            null,
                            DroolsEditorType.SYMBOL );
                } else {
                    match( input,
                            DRL5Lexer.SEMICOLON,
                            null,
                            null,
                            DroolsEditorType.SYMBOL );
                    break;
                }
            }

            //boolean qualified = type.indexOf( '.' ) >= 0;
            while ( //! qualified &&
                    input.LA( 1 ) == DRL5Lexer.ID && ! helper.validateIdentifierKey( DroolsSoftKeywords.END ) ) {
                // field*
                field( declare );
                if ( state.failed ) return null;
            }

            match( input,
                    DRL5Lexer.ID,
                    DroolsSoftKeywords.END,
                    null,
                    DroolsEditorType.KEYWORD );

            if ( state.failed ) return null;

        } catch ( RecognitionException re ) {
            reportError( re );
        } finally {
            helper.end( TypeDeclarationDescrBuilder.class,
                    declare );
        }
        return (declare != null) ? declare.getDescr() : 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.