use of de.bmoth.parser.ast.nodes.DeclarationNode in project bmoth by hhu-stups.
the class NumbersTest method lessEqualTest.
@Test
public void lessEqualTest() throws ParserException {
String formula = "x <= 2";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(INTEGER, declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.DeclarationNode in project bmoth by hhu-stups.
the class NumbersTest method nat1Test.
@Test
public void nat1Test() throws ParserException {
String formula = "x : NAT1";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(INTEGER, declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.DeclarationNode in project bmoth by hhu-stups.
the class NumbersTest method greaterTest.
/*
* number predicates
*/
@Test
public void greaterTest() throws ParserException {
String formula = "x > 2";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(INTEGER, declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.DeclarationNode in project bmoth by hhu-stups.
the class NumbersTest method sumTest.
@Test
public void sumTest() throws ParserException {
String formula = "x = 2 + 3";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(INTEGER, declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.DeclarationNode in project bmoth by hhu-stups.
the class NumbersTest method remainderTest.
@Test
public void remainderTest() throws ParserException {
String formula = "x = 6 mod 4";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(INTEGER, declarationNode.getType().toString());
}
Aggregations