Ejemplo n.º 1
0
        public static void ResolveMethodInvokation(MethodInvokationExpression method, Table.Table table)
        {
            ResolveMethodParameters(method.Parameters, table);

            if (table.CheckMethod(method.Name, method.GetParametersTypes(), true))
            {
                TableMethod tableMethod = table.FetchMethod(method.Name, method.GetParametersTypes());
                for (int i = 0; i < method.ArgCount; i++)
                {
                    method.Parameters[i].Type = tableMethod.Arguments[i].Type;
                }
                method.ReturnType = tableMethod.ReturnType;
            }
            else
            if (table.IsMethodWithThisNameDeclared(method.Name))
            {
                ReportError(new MethodWithThoseArgumentsIsNotDeclared(method.Name, method.SourceContext));
            }
            else
            {
                ReportError(new MethodIsNotDeclared(method.Name, method.SourceContext));
            }
        }