Exemplo n.º 1
0
        public Base_Object_Value Visit(AST_UnaryOp node)
        {
            Base_Object_Value l = Type_INT.Singleton().Instanciate();
            Base_Object_Value r = node.Exp.Visit(this);

            return(l.CallMethod(node.Op.Text, new Base_Object_Value[] { r }));
        }
Exemplo n.º 2
0
 public Base_Object_Value Visit(AST_Cte node)
 {
     if (node.Token.Type == "Int")
     {
         return(new Base_Object_Value(int.Parse(node.Token.Text), Type_INT.Singleton()));
     }
     if (node.Token.Type.ToLower() == "true")
     {
         return(new Base_Object_Value(1, Type_INT.Singleton()));
     }
     return(new Base_Object_Value(0, Type_INT.Singleton()));
 }