Search in sources :

Example 6 with PVariable

use of de.be4.eventbalg.core.parser.node.PVariable in project probparsers by bendisposto.

the class SourcePositionsTest method testGetEndLine.

@Test
public void testGetEndLine() throws Exception {
    final Start root = parser.parse("machine\nTestMachine\n\nvariables\nx\n\nend", false);
    final AMachineParseUnit parseUnit = (AMachineParseUnit) root.getPParseUnit();
    assertEquals(7, ((PositionedNode) parseUnit).getEndPos().getLine());
    final LinkedList<PVariable> variables = parseUnit.getVariables();
    assertEquals(5, ((PositionedNode) variables.get(0)).getEndPos().getLine());
}
Also used : Start(de.be4.eventb.core.parser.node.Start) PositionedNode(de.hhu.stups.sablecc.patch.PositionedNode) PVariable(de.be4.eventb.core.parser.node.PVariable) AMachineParseUnit(de.be4.eventb.core.parser.node.AMachineParseUnit) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 AMachineParseUnit (de.be4.eventb.core.parser.node.AMachineParseUnit)3 PVariable (de.be4.eventb.core.parser.node.PVariable)3 Start (de.be4.eventb.core.parser.node.Start)3 AMachineParseUnit (de.be4.eventbalg.core.parser.node.AMachineParseUnit)3 PVariable (de.be4.eventbalg.core.parser.node.PVariable)3 Start (de.be4.eventbalg.core.parser.node.Start)3 AVariable (de.be4.eventb.core.parser.node.AVariable)2 AVariable (de.be4.eventbalg.core.parser.node.AVariable)2 PositionedNode (de.hhu.stups.sablecc.patch.PositionedNode)2 StringTokenizer (java.util.StringTokenizer)2 TComment (de.be4.eventb.core.parser.node.TComment)1 TComment (de.be4.eventbalg.core.parser.node.TComment)1