Exemplo n.º 1
0
        public void VisitArgumentsNode(ArgumentsNode node)
        {
            List <ExpressionNode> arguments = node.Arguments;

            foreach (ExpressionNode arg in arguments)
            {
                arg.Accept(this);
                if (arg.Variable)
                {
                    Property p = arg.Scope.GetProperty(arg.VariableID);
                    if (!p.Assigned)
                    {
                        analyzer.notifyError(new UninitializedVariableError(arg));
                    }
                }
            }
        }
Exemplo n.º 2
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);
                }
            }
        }
Exemplo n.º 3
0
 public FunctionCallNode CreateFunctionCallNode(VariableIdNode idNode, ArgumentsNode arguments, Token token, Scope scope)
 {
     return(new FunctionCallNode(token, scope, idNode, arguments));
 }
Exemplo n.º 4
0
 public IOPrintNode(Token token, ArgumentsNode arguments, Scope scope)
     : base(token, scope)
 {
     this.arguments = arguments;
 }
Exemplo n.º 5
0
 public FunctionCallNode(Token token, Scope scope, VariableIdNode idNode, ArgumentsNode argumentsNode = null)
     : base(token, scope)
 {
     this.idNode        = idNode;
     this.argumentsNode = argumentsNode;
 }
Exemplo n.º 6
0
 public void VisitArgumentsNode(ArgumentsNode node)
 {
 }