public void namedConsequence(RuleDescrBuilder rule) {
        try {
            match(input,
                    DRL6Lexer.ID,
                    DroolsSoftKeywords.THEN,
                    null,
                    DroolsEditorType.KEYWORD);
            match(input,
                    DRL6Lexer.LEFT_SQUARE,
                    null,
                    null,
                    DroolsEditorType.SYMBOL);
            Token label = match(input,
                    DRL6Lexer.ID,
                    null,
                    null,
                    DroolsEditorType.SYMBOL);
            int first = input.index();
            match(input,
                    DRL6Lexer.RIGHT_SQUARE,
                    null,
                    null,
                    DroolsEditorType.SYMBOL);
            if (state.failed)
                return;

            String name = label.getText();
            String chunk = getConsequenceCode(first);

            // remove the closing squqre bracket "]" and any subsequent spaces and line breaks
            // keep indentation of 1st non-blank line
            chunk = chunk.replaceFirst("^\\]\\s*\\r?\\n?",
                    "");
            rule.namedRhs(name, chunk);

        } catch (RecognitionException re) {
            reportError(re);
        }
    }
public void namedConsequence ( RuleDescrBuilder rule ) { try { match ( input , DRL6Lexer . ID , DroolsSoftKeywords . THEN , null , DroolsEditorType . KEYWORD ) ; match ( input , DRL6Lexer . LEFT_SQUARE , null , null , DroolsEditorType . SYMBOL ) ; Token label = match ( input , DRL6Lexer . ID , null , null , DroolsEditorType . SYMBOL ) ; int first = input . index ( ) ; match ( input , DRL6Lexer . RIGHT_SQUARE , null , null , DroolsEditorType . SYMBOL ) ; if ( state . failed ) return ; String name = label . getText ( ) ; String chunk = getConsequenceCode ( first ) ; chunk = chunk . replaceFirst ( "^\\]\\s*\\r?\\n?" , "" ) ; rule . namedRhs ( name , chunk ) ; } catch ( RecognitionException re ) { reportError ( re ) ; } }
namedConsequence := THEN LEFT_SQUARE ID RIGHT_SQUARE chunk
@param rule