use of org.whole.lang.grammars.codebase.QueriesGrammar in project whole by wholeplatform.
the class PathExpressionsQueriesTest method testVariableJoinTest3.
@Test
public void testVariableJoinTest3() {
ITemplateManager tm = PathExpressionsQueriesTemplateManager.instance();
Grammar g = new QueriesGrammar().create();
PathExpression pe1 = (PathExpression) tm.create("recursiveProduction3");
StringBuilder names = new StringBuilder();
for (Production p : BehaviorUtils.<Production>compileAndLazyEvaluate(pe1, g)) names.append(p.getName().getValue());
Assert.assertEquals("ExpressionPathExpressionStepExpressionPredicate", names.toString());
}
use of org.whole.lang.grammars.codebase.QueriesGrammar in project whole by wholeplatform.
the class PathExpressionsQueriesTest method testSomePredicate.
@Test
public void testSomePredicate() {
ITemplateManager tm = PathExpressionsQueriesTemplateManager.instance();
Grammar g = new QueriesGrammar().create();
PathExpression pe1 = (PathExpression) tm.create("recursiveProduction6");
StringBuilder names = new StringBuilder();
for (Production p : BehaviorUtils.<Production>compileAndLazyEvaluate(pe1, g)) names.append(p.getName().getValue());
Assert.assertEquals("ExpressionPathExpressionStepExpressionPredicate", names.toString());
}
use of org.whole.lang.grammars.codebase.QueriesGrammar in project whole by wholeplatform.
the class PathExpressionsQueriesTest method testVariableJoinTest4.
@Test
public void testVariableJoinTest4() {
ITemplateManager tm = PathExpressionsQueriesTemplateManager.instance();
Grammar g = new QueriesGrammar().create();
PathExpression pe1 = (PathExpression) tm.create("recursiveProduction4");
StringBuilder names = new StringBuilder();
for (Production p : BehaviorUtils.<Production>compileAndLazyEvaluate(pe1, g)) names.append(p.getName().getValue());
Assert.assertEquals("ExpressionPathExpressionStepExpressionPredicate", names.toString());
}
use of org.whole.lang.grammars.codebase.QueriesGrammar in project whole by wholeplatform.
the class PathExpressionsQueriesTest method testVariableJoinTest5.
@Test
public void testVariableJoinTest5() {
ITemplateManager tm = PathExpressionsQueriesTemplateManager.instance();
Grammar g = new QueriesGrammar().create();
PathExpression pe1 = (PathExpression) tm.create("recursiveProduction5");
StringBuilder names = new StringBuilder();
for (Production p : BehaviorUtils.<Production>compileAndLazyEvaluate(pe1, g)) names.append(p.getName().getValue());
Assert.assertEquals("ExpressionPathExpressionStepExpressionPredicate", names.toString());
}
use of org.whole.lang.grammars.codebase.QueriesGrammar in project whole by wholeplatform.
the class PathExpressionsQueriesTest method testEveryPredicate.
@Test
public void testEveryPredicate() {
ITemplateManager tm = PathExpressionsQueriesTemplateManager.instance();
Grammar g = new QueriesGrammar().create();
PathExpression pe1 = (PathExpression) tm.create("unusedProduction");
IEntityIterator<Production> iterator = BehaviorUtils.<Production>compileAndLazyEvaluate(pe1, g);
Assert.assertTrue(iterator.hasNext());
Production p = iterator.next();
Assert.assertEquals("Statement", p.getName().getValue());
Assert.assertTrue(iterator.hasNext());
p = iterator.next();
Assert.assertEquals("Declaration", p.getName().getValue());
Assert.assertTrue(iterator.hasNext());
p = iterator.next();
Assert.assertEquals("Index", p.getName().getValue());
Assert.assertFalse(iterator.hasNext());
}
Aggregations