private void checkout(AstNode theNode) { foreach (AstNode node in theNode.Children) { if (node is BinOpNode) { BinOpNode bnode = ((BinOpNode)node); if (((BinOpNode)node).BinOp == BinaryOperation.Assignment) { if (!result.Symbols.Contains(bnode.Left.ToString())) { result.Symbols.Add(bnode.Left.ToString()); } } } else { checkout(node); } } foreach (AstNode node in theNode.Children) { if (node is FuncNode) { FuncNode fnode = ((FuncNode)node); currentLocalScope = new LocalScope(); result.ChildScopes[fnode.Name] = currentLocalScope; currentLocalScope.Symbols.AddRange(fnode.Parameters); analyseLocalCode(fnode.Body); } } }
private void checkout(AstNode theNode) { foreach(AstNode node in theNode.Children) if (node is BinOpNode) { BinOpNode bnode = ((BinOpNode)node); if (((BinOpNode)node).BinOp == BinaryOperation.Assignment) { if (!result.Symbols.Contains(bnode.Left.ToString())) { result.Symbols.Add(bnode.Left.ToString()); } } } else checkout(node); foreach(AstNode node in theNode.Children) if (node is FuncNode) { FuncNode fnode = ((FuncNode)node); currentLocalScope = new LocalScope(); result.ChildScopes[fnode.Name] = currentLocalScope; currentLocalScope.Symbols.AddRange(fnode.Parameters); analyseLocalCode(fnode.Body); } }
public HassiumFunction(Interpreter interpreter, FuncNode funcNode, LocalScope localScope) { this.interpreter = interpreter; this.funcNode = funcNode; this.localScope = localScope; }
public StackFrame(LocalScope scope) { this.Scope = scope; this.Locals = new Dictionary <string, object>(); }
public StackFrame(LocalScope scope) { this.Scope = scope; this.Locals = new Dictionary<string, object>(); }