use of org.eclipse.xtext.AbstractRule in project xtext-core by eclipse.
the class TreeConstTest method testAssignedAction3.
@Test
public void testAssignedAction3() throws Exception {
AbstractRule rule = parseRule("Model: 'a' {Type1.sub=current} | 'b' {Type2.sub=current};");
assertTypes(nfa.getNFA(rule.getAlternatives()).getTypes(), "Type1", "Type2");
}
use of org.eclipse.xtext.AbstractRule in project xtext-core by eclipse.
the class TreeConstTest method testRuleCall2.
@Test
public void testRuleCall2() throws Exception {
AbstractRule rule = parseRule("Model: Foo | 'bar'; Foo: name=ID;");
assertTypes(nfa.getNFA(rule.getAlternatives()).getTypes(), "Foo", "null");
}
use of org.eclipse.xtext.AbstractRule in project xtext-core by eclipse.
the class TreeConstTest method testRuleCall3.
@Test
public void testRuleCall3() throws Exception {
AbstractRule rule = parseRule("Model: Foo | 'bar' name=ID | 'null'; Foo: name=ID;");
assertTypes(nfa.getNFA(rule.getAlternatives()).getTypes(), "Foo", "Model", "null");
}
use of org.eclipse.xtext.AbstractRule in project xtext-core by eclipse.
the class TreeConstTest method testSingleAssignmentOrNull.
@Test
public void testSingleAssignmentOrNull() throws Exception {
AbstractRule rule = parseRule("Model: 'foo' name=ID?;");
Group group = (Group) rule.getAlternatives();
assertTypes(nfa.getNFA(group).getTypes(), "Model", "null");
assertTypes(nfa.getNFA(group.getElements().get(0)).getTypesToCheck());
}
use of org.eclipse.xtext.AbstractRule in project xtext-core by eclipse.
the class TreeConstTest method testRuleCall1.
@Test
public void testRuleCall1() throws Exception {
AbstractRule rule = parseRule("Model: Foo; Foo: name=ID;");
assertTypes(nfa.getNFA(rule.getAlternatives()).getTypes(), "Foo");
}
Aggregations