示例#1
0
        private void doTestBoolean(bool expectedValue)
        {
            CSTNode node = parseOK(expectedValue.ToString().ToLower(), this.getCurrentMethodName());

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

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

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

            Assert.IsNotNull(type);
            Assert.AreEqual("Boolean", type.getName());
        }
 public void visitBooleanLiteralExp(BooleanLiteralExp exp)
 {
     // get boolean symbol and add to formula
     formula += exp.isBooleanSymbol();
 }