Exemple #1
0
        public void VisitFunctionCallNode(FunctionCallNode node)
        {
            node.Accept(this.typeChecker);
            VariableIdNode idNode    = node.IdNode;
            ArgumentsNode  arguments = node.ArgumentsNode;

            idNode.Accept(this);

            if (arguments != null)
            {
                arguments.Accept(this);

                if (!analyzer.SyntaxTree.Root.Functions.ContainsKey(idNode.ID))
                {
                    analyzer.notifyError(new NotAValidFunctionError(idNode));
                }
                else
                {
                    FunctionNode function = analyzer.SyntaxTree.Root.Functions [idNode.ID];

                    CompareParamsAndArgs(node, function.Parameters.Parameters, arguments.Arguments);
                }
            }
        }