public string Visit(Call_Method node) { List <string> Args = new List <string>(); foreach (var exp in node.args.list_Node) { string value = exp.Visit(this); Args.Add(value); } var expr = method.Add_local("expr", true); method.Add_Instruction(new CIL_Call(expr, node.name.name, "this", Args)); return(expr); }
public bool Visit(Call_Method node) { bool solve = true; foreach (var arg in node.args.list_Node) { solve &= this.Visit(arg); } if (!Context.IsDefineMethod(node.name.name, Context.ActualType)) { Logger += "En la expresion " + node.ToString() + "-> error de identificador (metodo '" + node.name.name + "' no esta definido) \n"; solve = false; } return(solve); }
public IType Visit(Call_Method node) { Method m = Context.ActualType.GetMethod(node.name.name); for (int i = 0; i < node.args.list_Node.Count; i++) { var exp = node.args.list_Node[i]; IType type = this.Visit(exp); if (type != null && m.Arguments[i].Type != null && !type.Conform(m.Arguments[i].Type)) { Logger += "En la expresion " + node.ToString() + "-> error de tipos (El tipo de la expresion " + (i + 1).ToString() + " no se conforma al del argumento)\n"; return(null); } } return(Context.GetType(m.ReturnType.Name)); }
public bool Visit(Call_Method node) { return(true); }
public bool Visit(Call_Method node) { throw new System.NotImplementedException(); }