Package org.drools.compiler.lang.descr

Examples of org.drools.compiler.lang.descr.BaseDescr


     *
     * @return
     * @throws RecognitionException
     */
    public BaseDescr declare( PackageDescrBuilder pkg ) throws RecognitionException {
        BaseDescr declaration = null;
        try {
            DeclareDescrBuilder declare = helper.start( pkg,
                                                        DeclareDescrBuilder.class,
                                                        null );

View Full Code Here


     * @param allowOr
     * @throws RecognitionException
     */
    private BaseDescr lhsOr( final CEDescrBuilder< ? , ? > ce,
                             boolean allowOr ) throws RecognitionException {
        BaseDescr result = null;
        if ( allowOr && input.LA( 1 ) == DRL5Lexer.LEFT_PAREN && helper.validateLT( 2,
                                                                                   DroolsSoftKeywords.OR ) ) {
            // prefixed OR
            CEDescrBuilder< ? , OrDescr> or = null;
            if ( state.backtracking == 0 ) {
View Full Code Here

     * @param ce
     * @throws RecognitionException
     */
    private BaseDescr lhsAnd( final CEDescrBuilder< ? , ? > ce,
                              boolean allowOr ) throws RecognitionException {
        BaseDescr result = null;
        if ( input.LA( 1 ) == DRL5Lexer.LEFT_PAREN && helper.validateLT( 2,
                                                                        DroolsSoftKeywords.AND ) ) {
            // prefixed AND
            CEDescrBuilder< ? , AndDescr> and = null;
            if ( state.backtracking == 0 ) {
View Full Code Here

     * @param ce
     * @return
     */
    private BaseDescr lhsUnary( final CEDescrBuilder< ? , ? > ce,
                                boolean allowOr ) throws RecognitionException {
        BaseDescr result = null;
        if ( helper.validateIdentifierKey( DroolsSoftKeywords.EXISTS ) ) {
            result = lhsExists( ce,
                                allowOr );
            if ( helper.validateIdentifierKey( DroolsSoftKeywords.DO ) ) {
                namedConsequence( ce, null );
View Full Code Here

     *
     * @param ce
     * @return
     */
    private BaseDescr consequenceInvocation( CEDescrBuilder< ? , ? > ce ) throws RecognitionException {
        BaseDescr result = null;
        if ( helper.validateIdentifierKey( DroolsSoftKeywords.IF ) ) {
            result = conditionalBranch( ce, null );
        } else if ( helper.validateIdentifierKey( DroolsSoftKeywords.DO ) ) {
            result = namedConsequence( ce, null );
        }
View Full Code Here

        if ( state.failed ) return null;

        if ( state.backtracking == 0 && input.LA( 1 ) != DRL5Lexer.EOF ) {
            helper.emit( Location.LOCATION_LHS_BEGIN_OF_CONDITION );
        }
        BaseDescr descr = lhsOr( ce,
                                 allowOr );
        if ( state.failed ) return null;

        match( input,
               DRL5Lexer.RIGHT_PAREN,
View Full Code Here

    @SuppressWarnings("unchecked")
    private BaseDescr lhsPatternBind( PatternContainerDescrBuilder< ? , ? > ce,
                                      final boolean allowOr ) throws RecognitionException {
        PatternDescrBuilder< ? > pattern = null;
        CEDescrBuilder< ? , OrDescr> or = null;
        BaseDescr result = null;

        Token first = input.LT( 1 );
        pattern = helper.start( (DescrBuilder< ? , ? >) ce,
                                PatternDescrBuilder.class,
                                null );
View Full Code Here

     * @return
     * @throws RecognitionException
     */
    private BaseDescr lhsAccumulate( PatternContainerDescrBuilder< ? , ? > ce ) throws RecognitionException {
        PatternDescrBuilder< ? > pattern = null;
        BaseDescr result = null;

        pattern = helper.start( (DescrBuilder< ? , ? >) ce,
                                PatternDescrBuilder.class,
                                null );
        if ( pattern != null ) {
View Full Code Here

            // expression consumed something
            int last = input.LT( -1 ).getTokenIndex();
            String expr = toExpression(prefix, first, last);
            pattern.constraint( expr,
                                positional );
            BaseDescr constrDescr = pattern.getDescr().getDescrs().get( pattern.getDescr().getDescrs().size() - 1 );
            constrDescr.setLocation( input.get( first ).getLine(),
                                     input.get( first ).getCharPositionInLine() );
            constrDescr.setEndLocation( input.get( last ).getLine(),
                                        input.get( last ).getCharPositionInLine() );
            constrDescr.setStartCharacter( ((CommonToken)input.get( first )).getStartIndex() );
            constrDescr.setEndCharacter( ((CommonToken)input.get( last )).getStopIndex() );
        }
    }
View Full Code Here

     *           ;
     *
     * @throws org.antlr.runtime.RecognitionException
     */
    public BaseDescr statement(PackageDescrBuilder pkg) throws RecognitionException {
        BaseDescr descr = null;
        try {
            if (helper.validateIdentifierKey(DroolsSoftKeywords.IMPORT)) {
                descr = importStatement(pkg);
                if (state.failed)
                    return descr;
View Full Code Here

TOP

Related Classes of org.drools.compiler.lang.descr.BaseDescr

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.