Search in sources :

Example 1 with SyntaxTrees.makeCompoundSyntaxTree

use of com.sri.ai.expresso.helper.SyntaxTrees.makeCompoundSyntaxTree in project aic-expresso by aic-sri-international.

the class AbstractIntensionalSet method makeSyntaxTree.

private SyntaxTree makeSyntaxTree() {
    IndexExpressionsSet indexExpressions = getIndexExpressions();
    SyntaxTree parametersSyntaxTree = indexExpressions.getSubSyntaxTree();
    SyntaxTree scopingSyntaxTree = new DefaultCompoundSyntaxTree(IntensionalSet.SCOPED_VARIABLES_LABEL, parametersSyntaxTree);
    SyntaxTree headSyntaxTree = getHead().getSyntaxTree();
    SyntaxTree conditionSyntaxTree = (getCondition() == null || getCondition().equals("true")) ? null : SyntaxTrees.makeCompoundSyntaxTree(IntensionalSet.CONDITION_LABEL, condition.getSyntaxTree());
    cachedSyntaxTree = makeCompoundSyntaxTree(getSyntaxTreeLabel(), scopingSyntaxTree, headSyntaxTree, conditionSyntaxTree);
    return cachedSyntaxTree;
}
Also used : SyntaxTree(com.sri.ai.expresso.api.SyntaxTree) SyntaxTrees.makeCompoundSyntaxTree(com.sri.ai.expresso.helper.SyntaxTrees.makeCompoundSyntaxTree) IndexExpressionsSet(com.sri.ai.expresso.api.IndexExpressionsSet)

Aggregations

IndexExpressionsSet (com.sri.ai.expresso.api.IndexExpressionsSet)1 SyntaxTree (com.sri.ai.expresso.api.SyntaxTree)1 SyntaxTrees.makeCompoundSyntaxTree (com.sri.ai.expresso.helper.SyntaxTrees.makeCompoundSyntaxTree)1