use of de.bmoth.parser.ast.nodes.DeclarationNode in project bmoth by hhu-stups.
the class RelationTest method iterationTest.
@Test
@Ignore
public void iterationTest() throws ParserException {
String formula = "x = iterate({1|->2,2|->3},2)";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(POW_INTEGER_INTEGER, declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.DeclarationNode in project bmoth by hhu-stups.
the class SequenceTest method appendTest.
@Test
public void appendTest() throws ParserException {
String formula = "x = {1|->2,2|->3} <- 5";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(POW_INTEGER_INTEGER, declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.DeclarationNode in project bmoth by hhu-stups.
the class SequenceTest method dropTest.
@Test
public void dropTest() throws ParserException {
String formula = "x = [2,3,4]\\|/2";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(POW_INTEGER_INTEGER, declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.DeclarationNode in project bmoth by hhu-stups.
the class SequenceTest method takeTest.
@Test
public void takeTest() throws ParserException {
String formula = "x = [2,3,4]/|\\2";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(POW_INTEGER_INTEGER, declarationNode.getType().toString());
}
use of de.bmoth.parser.ast.nodes.DeclarationNode in project bmoth by hhu-stups.
the class SequenceTest method sequenceConstructionTest.
@Test
public void sequenceConstructionTest() throws ParserException {
String formula = "x = [2,3,4]";
FormulaNode formulaNode = Parser.getFormulaAsSemanticAst(formula);
assertEquals(PREDICATE_FORMULA, formulaNode.getFormulaType());
DeclarationNode declarationNode = formulaNode.getImplicitDeclarations().get(0);
assertEquals("x", declarationNode.getName());
assertEquals(POW_INTEGER_INTEGER, declarationNode.getType().toString());
}
Aggregations