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 })); }
public string Visit(AST_UnaryOp node) { var e = node.Exp.Visit(this); var s = methodcontext.GenLocal("exp", true); methodcontext.Staments.Add(new CIL_ExpUn(e, node.Op.Text, s)); return(s); }
public bool Visit(AST_UnaryOp node) { bool solve = true; if (!node.Exp.Visit(this)) { return(false); } node.MyType = node.Exp.MyType; if (node.Op.Text == "not") { if (node.Exp.MyType.Name != "Bool") { CurrErrorLoger.LogError(node.row, node.col, "No se puede aplicar not a una expresion no booleana"); return(false); } } else { if (node.Op.Text == "~" || node.Op.Text == "-") { if (node.Exp.MyType.Name == "Bool") { CurrErrorLoger.LogError(node.row, node.col, "Operacion invalida para una expresion booleana"); return(false); } else if (node.Exp.MyType.Name != "Int") { CurrErrorLoger.LogError(node.row, node.col, "Operacion invalida solo aplicables para tipos Int"); return(false); } } } return(true); }
public bool Visit(AST_UnaryOp node) { return(node.Exp.Visit(this)); }
public bool Visit(AST_UnaryOp node) { throw new NotImplementedException(); }