示例#1
0
        public override bool Walk(FoxPro.Compiler.Ast.ClassDefinition node)
        {
            ClassNode classNode = new ClassNode(node);

            AddNode(classNode);
            return(true);
        }
示例#2
0
        // ClassDefinition
        public override bool Walk(FoxPro.Compiler.Ast.ClassDefinition node)
        {
            Define(node.Name, new ClassDefinition(node));

            // Base references are in the outer scope
            foreach (Expression b in node.Bases)
            {
                b.Walk(this);
            }

            // And so is the __name__ reference
            Reference(SymbolTable.Name);

            PushScope(node);

            // define the __doc__
            SymbolId doc = SymbolTable.Doc;

            Define(doc, new DirectDefinition(typeof(string)));

            // Walk the body
            node.Body.Walk(this);
            return(false);
        }
示例#3
0
 public void PostWalk(FoxPro.Compiler.Ast.ClassDefinition node)
 {
     AssertCurrent(node); current = current.Parent;
 }
示例#4
0
 // ClassDefinition
 public bool Walk(FoxPro.Compiler.Ast.ClassDefinition node)
 {
     current = node; return(Process(node));
 }
示例#5
0
 public ClassScope(Module module, Scope parent, FoxPro.Compiler.Ast.ClassDefinition statement)
     : base(module, parent)
 {
     this.statement = statement;
 }
示例#6
0
 public ClassNode(FoxPro.Compiler.Ast.ClassDefinition cls)
 {
     this.cls = cls;
 }
示例#7
0
 public override void PostWalk(FoxPro.Compiler.Ast.ClassDefinition node)
 {
     scopes.Pop();
 }
示例#8
0
 public ClassDefinition(FoxPro.Compiler.Ast.ClassDefinition @class)
 {
     this.@class = @class;
 }
示例#9
0
 private List <Inferred> InferClassDef(FoxPro.Compiler.Ast.ClassDefinition node, Scope scope)
 {
     return(Engine.MakeList <Inferred>(module.GetClass(node)));
 }
示例#10
0
 private void PushScope(FoxPro.Compiler.Ast.ClassDefinition cls)
 {
     PushScope(new ClassScope(module, current, cls));
 }
示例#11
0
 public InferredClass GetClass(FoxPro.Compiler.Ast.ClassDefinition cls)
 {
     Debug.Assert(scopes.ContainsKey(cls));
     return(new InferredClass(scopes[cls] as ClassScope));
 }