Search in sources :

Example 6 with QueriesGrammar

use of org.whole.lang.grammars.codebase.QueriesGrammar in project whole by wholeplatform.

the class PathExpressionsQueriesTest method testVariableJoinTest2.

@Test
public void testVariableJoinTest2() {
    ITemplateManager tm = PathExpressionsQueriesTemplateManager.instance();
    Grammar g = new QueriesGrammar().create();
    PathExpression pe1 = (PathExpression) tm.create("recursiveProduction2");
    StringBuilder names = new StringBuilder();
    for (Production p : BehaviorUtils.<Production>compileAndLazyEvaluate(pe1, g)) names.append(p.getName().getValue());
    Assert.assertEquals("ExpressionPathExpressionStepExpressionPredicate", names.toString());
}
Also used : PathExpression(org.whole.lang.queries.model.PathExpression) Production(org.whole.lang.grammars.model.Production) ITemplateManager(org.whole.lang.templates.ITemplateManager) TestXmlGrammar(org.whole.lang.grammars.util.TestXmlGrammar) Grammar(org.whole.lang.grammars.model.Grammar) QueriesGrammar(org.whole.lang.grammars.codebase.QueriesGrammar) QueriesGrammar(org.whole.lang.grammars.codebase.QueriesGrammar) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 QueriesGrammar (org.whole.lang.grammars.codebase.QueriesGrammar)6 Grammar (org.whole.lang.grammars.model.Grammar)6 Production (org.whole.lang.grammars.model.Production)6 TestXmlGrammar (org.whole.lang.grammars.util.TestXmlGrammar)6 PathExpression (org.whole.lang.queries.model.PathExpression)6 ITemplateManager (org.whole.lang.templates.ITemplateManager)6