Esempio n. 1
0
        private void doTestReal(String expectedValueStr, double expectedValue)
        {
            CSTNode node = parseOK(expectedValueStr, this.getCurrentMethodName());

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

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

            Assert.AreEqual(expectedValue, Double.Parse(ast.getRealSymbol(), CultureInfo.InvariantCulture));
            CoreClassifier type = ast.getType();

            Assert.IsNotNull(type);
            Assert.AreEqual("Real", type.getName());
        }
 public void visitRealLiteralExp(RealLiteralExp exp)
 {
     // get real symbol and add to formula
     formula += exp.getRealSymbol();
 }