Package org.drools.compiler.lang.descr

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


                data.putInvoker( className,
                                 invoker );
            }
            final String text = invokers.getValue();

            final BaseDescr descr = (BaseDescr) context.getDescrLookups().get( className );
            addClassCompileTask( className,
                                 descr,
                                 text,
                                 this.src,
                                 new RuleInvokerErrorHandler( descr,
View Full Code Here


            args.add( extraDescr );
        }

        // Deal with the constraints, both positional and bindings
        for ( int i = 0, length = args.size(); i < length; i++ ) {
            BaseDescr base = args.get( i );

            String expression = null;
            boolean isPositional = false;
            boolean isBinding = false;
            BindingDescr bind = null;
            ConstraintConnectiveDescr result = null;
            if ( base instanceof BindingDescr ) {
                bind = (BindingDescr) base;
                expression = bind.getVariable() + (bind.isUnification() ? " := " : " : ") + bind.getExpression();
                isBinding = true;
            } else {
                if ( base instanceof ExprConstraintDescr ) {
                    ExprConstraintDescr ecd = (ExprConstraintDescr) base;
                    expression = ecd.getExpression();
                    isPositional = ecd.getType() == ExprConstraintDescr.Type.POSITIONAL;

                } else {
                    expression = base.getText();
                }

                result = parseExpression( context,
                                          patternDescr,
                                          expression );
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

     *
     * @return
     * @throws org.antlr.runtime.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 org.antlr.runtime.RecognitionException
     */
    private BaseDescr lhsOr(final CEDescrBuilder<?, ?> ce,
            boolean allowOr) throws RecognitionException {
        BaseDescr result = null;
        if (allowOr && input.LA(1) == DRL6Lexer.LEFT_PAREN && helper.validateLT(2,
                DroolsSoftKeywords.OR)) {
            // prefixed OR
            CEDescrBuilder<?, OrDescr> or = null;
            if (state.backtracking == 0) {
View Full Code Here

     * @param ce
     * @throws org.antlr.runtime.RecognitionException
     */
    private BaseDescr lhsAnd(final CEDescrBuilder<?, ?> ce,
            boolean allowOr) throws RecognitionException {
        BaseDescr result = null;
        if (input.LA(1) == DRL6Lexer.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

            return null;

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

        match(input,
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

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.