public override Type Check(TEnv env) { FunDecl funDecl = env.GetFun(funName); for (int i = 0; i < arguments.Length; i++) { if (!funDecl.parameters[i].type.Equals(arguments[i].Check(env))) { throw new CompileException("Type mismatch in argument {0} of {1}", funDecl.parameters[i].name, funName); } } return(Type.voidType); }
public void AddFun(FunDecl decl) { functions.Add(decl.name, decl); }