[jboss-jira] [JBoss JIRA] (DROOLS-4397) Make drools-model-compiler dialect agnostic

Luca Molteni (Jira) issues at jboss.org
Fri Aug 2 09:57:00 EDT 2019


    [ https://issues.jboss.org/browse/DROOLS-4397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13766508#comment-13766508 ] 

Luca Molteni commented on DROOLS-4397:
--------------------------------------

Braindump:


@Luca Molteni  ok there?
look at AbstractASMConsequenceBuilder
we rewrite the java string here - String fixedConsequence = KnowledgeHelperFixer.fix( DialectUtil.fixBlockDescr(context, analysis, decls) );
but also see this line above - JavaAnalysisResult analysis = JavaRuleBuilderHelper.createJavaAnalysisResult(context, consequenceName, decls);
this does a full java parse, with antlr.
see JavaDialect.analyzeBlock
@Luca Molteni  clearly this is pointless. we can parse with JavaParser once. keep the AST around.
in fact you have to reverse the order too.
so parse with  JavaParser first. rewrite it to pure java. then get the analyser.
analyser just returns the variables. which javaparser can do for you.
but you can do this one step at a time. first just  replace this line. String fixedConsequence = KnowledgeHelperFixer.fix( DialectUtil.fixBlockDescr(context, analysis, decls) );


> Make drools-model-compiler dialect agnostic
> -------------------------------------------
>
>                 Key: DROOLS-4397
>                 URL: https://issues.jboss.org/browse/DROOLS-4397
>             Project: Drools
>          Issue Type: Task
>          Components: executable model
>            Reporter: Luca Molteni
>            Assignee: Luca Molteni
>            Priority: Major
>
> By preprocessing it with the mvel compiler before going into the drools-executable-model



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list