Ejemplo n.º 1
0
        protected IEnumerable <Proposition> ConvertFromAST(AST ast, Language.Symbol oper)
        {
            if (ast == null)
            {
                return(null);
            }

            List <Proposition> result = new List <Proposition>();
            string             type   = ast.GetType().Name;

            if (type == "ASTOpBinary")
            {
                ASTOpBinary opBin = ast as ASTOpBinary;
                if (opBin.value == oper)
                {
                    result.AddRange(ConvertFromAST(opBin.left, oper));
                    result.AddRange(ConvertFromAST(opBin.right, oper));
                    return(result);
                }
            }

            // else
            result.Add(Proposition.FromAST(ast));
            return(result);
        }
Ejemplo n.º 2
0
 // transitional constructor
 public BinaryOperation(ASTOpBinary ast)
 {
     Left  = Proposition.FromAST(ast.left);
     Right = Proposition.FromAST(ast.right);
 }
Ejemplo n.º 3
0
 // transitional constructor.
 public UnaryOperation(ASTOpUnary ast)
 {
     P = Proposition.FromAST(ast.ast);
 }