示例#1
0
        public override bool Walk(FoxPro.Compiler.Ast.FunctionDefinition node)
        {
            FunctionNode functionNode = new FunctionNode(node);

            AddNode(functionNode);
            return(true);
        }
示例#2
0
        public void Analyze(FoxPro.Compiler.Ast.FunctionDefinition function)
        {
            this.argument = 0;
            this.function = function;

            foreach (Expression param in function.Parameters)
            {
                param.Walk(this);
                argument++;
            }
        }
示例#3
0
        // FunctionDefinition
        public override bool Walk(FoxPro.Compiler.Ast.FunctionDefinition node)
        {
            // Name is defined in the enclosing scope
            Define(node.Name, new FunctionDefinition(node));

            // process the default arg values in the outer scope
            foreach (Expression e in node.Defaults)
            {
                e.Walk(this);
            }
            // process the decorators in the outer scope
            if (node.Decorators != null)
            {
                node.Decorators.Walk(this);
            }

            PushScope(node);

            argumentAnalyzer.Analyze(node);
            return(true);
        }
示例#4
0
 public void PostWalk(FoxPro.Compiler.Ast.FunctionDefinition node)
 {
     AssertCurrent(node); current = current.Parent;
 }
示例#5
0
 // FunctionDefinition
 public bool Walk(FoxPro.Compiler.Ast.FunctionDefinition node)
 {
     current = node; return(Process(node));
 }
示例#6
0
 public FunctionScope(Module module, Scope parent, FoxPro.Compiler.Ast.FunctionDefinition statement)
     : base(module, parent)
 {
     this.statement = statement;
 }
示例#7
0
 public FunctionNode(FoxPro.Compiler.Ast.FunctionDefinition functionDefinition)
 {
     this.func = functionDefinition;
 }
示例#8
0
 public override void PostWalk(FoxPro.Compiler.Ast.FunctionDefinition node)
 {
     scopes.Pop();
 }
示例#9
0
 public ArgumentDefinition(SymbolId name, FoxPro.Compiler.Ast.FunctionDefinition function, int argument)
 {
     this.name     = name;
     this.function = function;
     this.argument = argument;
 }
示例#10
0
 private List <Inferred> InferFuncDef(FoxPro.Compiler.Ast.FunctionDefinition node, Scope scope)
 {
     Debug.Print("Not implemented: InferFuncDefIn");
     return(null);
 }
示例#11
0
 private void PushScope(FoxPro.Compiler.Ast.FunctionDefinition func)
 {
     PushScope(new FunctionScope(module, current, func));
 }
示例#12
0
 public FunctionDefinitionInfo(FoxPro.Compiler.Ast.FunctionDefinition function)
 {
     this.function = function;
 }