Ejemplo n.º 1
0
        private void doTestInteger(int expectedValue)
        {
            CSTNode node = parseOK(expectedValue.ToString(CultureInfo.InvariantCulture), this.getCurrentMethodName());

            Assert.IsTrue(node is CSTIntegerLiteralExpCS);
            CSTIntegerLiteralExpCS literalExp = (CSTIntegerLiteralExpCS)node;

            Assert.IsNotNull(literalExp.getAst());
            Assert.IsTrue(literalExp.getAst() is IntegerLiteralExp);
            IntegerLiteralExp ast = (IntegerLiteralExp)literalExp.getAst();

            Assert.AreEqual(expectedValue, ast.getIntegerSymbol());
            CoreClassifier type = ast.getType();

            Assert.IsNotNull(type);
            Assert.AreEqual("Integer", type.getName());
        }
 public void visitIntegerLiteralExp(IntegerLiteralExp exp)
 {
     // get integer symbol and add to formula
     formula += exp.getIntegerSymbol();
 }