use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.
the class PackageDescrResourceVisitor method visit.
protected void visit(final ForallDescr descr) {
checkResource(descr);
visit(descr.getBasePattern());
for (BaseDescr o : descr.getDescrs()) {
visit(o);
}
}
use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.
the class PackageDescrResourceVisitor method visit.
protected void visit(final CollectDescr descr) {
checkResource(descr);
visit(descr.getInputPattern());
for (BaseDescr d : descr.getDescrs()) {
visit(d);
}
}
use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.
the class AndVisitor method visit.
public void visit(AndDescr descr) {
// if it's the first (implied) `and` wrapping the first level of patterns, skip adding it to the DSL.
if (this.context.getExprPointerLevel() != 1) {
final MethodCallExpr andDSL = new MethodCallExpr(null, "and");
this.context.addExpression(andDSL);
this.context.pushExprPointer(andDSL::addArgument);
}
for (BaseDescr subDescr : descr.getDescrs()) {
this.context.parentDesc = descr;
subDescr.accept(visitor);
}
if (this.context.getExprPointerLevel() != 1) {
this.context.popExprPointer();
}
}
use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.
the class ConditionalElementVisitor method visit.
public void visit(ConditionalElementDescr descr, String methodName) {
final MethodCallExpr ceDSL = new MethodCallExpr(null, methodName);
this.context.addExpression(ceDSL);
this.context.pushExprPointer(ceDSL::addArgument);
for (BaseDescr subDescr : descr.getDescrs()) {
subDescr.accept(visitor);
}
this.context.popExprPointer();
}
use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.
the class OrVisitor method visit.
public void visit(ConditionalElementDescr descr, String methodName) {
final MethodCallExpr ceDSL = new MethodCallExpr(null, methodName);
context.addExpression(ceDSL);
for (BaseDescr subDescr : descr.getDescrs()) {
final MethodCallExpr andDSL = new MethodCallExpr(null, "and");
context.pushExprPointer(andDSL::addArgument);
subDescr.accept(modelGeneratorVisitor);
context.popExprPointer();
ceDSL.addArgument(andDSL);
}
}
Aggregations