use of org.drools.compiler.lang.api.NamedConsequenceDescrBuilder in project drools by kiegroup.
the class DRL5Parser method namedConsequence.
/**
* namedConsequence := DO LEFT_SQUARE ID RIGHT_SQUARE BREAK?
*/
private BaseDescr namedConsequence(CEDescrBuilder<?, ?> ce, NamedConsequenceDescrBuilder<?> namedConsequence) throws RecognitionException {
if (namedConsequence == null) {
namedConsequence = helper.start((DescrBuilder<?, ?>) ce, NamedConsequenceDescrBuilder.class, null);
}
try {
match(input, DRL5Lexer.ID, DroolsSoftKeywords.DO, null, DroolsEditorType.KEYWORD);
if (state.failed)
return null;
match(input, DRL5Lexer.LEFT_SQUARE, null, null, DroolsEditorType.SYMBOL);
if (state.failed)
return null;
Token label = match(input, DRL5Lexer.ID, null, null, DroolsEditorType.SYMBOL);
if (state.failed)
return null;
namedConsequence.name(label.getText());
match(input, DRL5Lexer.RIGHT_SQUARE, null, null, DroolsEditorType.SYMBOL);
if (state.failed)
return null;
} finally {
helper.end(NamedConsequenceDescrBuilder.class, namedConsequence);
}
return namedConsequence.getDescr();
}
use of org.drools.compiler.lang.api.NamedConsequenceDescrBuilder in project drools by kiegroup.
the class DRL5Parser method breakingNamedConsequence.
/**
* breakingNamedConsequence := BREAK LEFT_SQUARE ID RIGHT_SQUARE
*/
private BaseDescr breakingNamedConsequence(CEDescrBuilder<?, ?> ce, NamedConsequenceDescrBuilder<?> namedConsequence) throws RecognitionException {
if (namedConsequence == null) {
namedConsequence = helper.start((DescrBuilder<?, ?>) ce, NamedConsequenceDescrBuilder.class, null);
}
try {
match(input, DRL5Lexer.ID, DroolsSoftKeywords.BREAK, null, DroolsEditorType.KEYWORD);
if (state.failed)
return null;
match(input, DRL5Lexer.LEFT_SQUARE, null, null, DroolsEditorType.SYMBOL);
if (state.failed)
return null;
Token label = match(input, DRL5Lexer.ID, null, null, DroolsEditorType.SYMBOL);
if (state.failed)
return null;
namedConsequence.name(label.getText());
namedConsequence.breaking(true);
match(input, DRL5Lexer.RIGHT_SQUARE, null, null, DroolsEditorType.SYMBOL);
if (state.failed)
return null;
} finally {
helper.end(NamedConsequenceDescrBuilder.class, namedConsequence);
}
return namedConsequence.getDescr();
}
Aggregations