public virtual void Visit(MainClassDeclNode node) { ClassBeingVisited = Analysis.Environment.Classes.Lookup(node.classIdentifier.name); MethodBeingVisited = ClassBeingVisited.Methods.Lookup("main"); node.classIdentifier.Accept(this); node.mainParameterIdentifier.Accept(this); node.statement.Accept(this); }
public virtual void Visit(MethodDeclNode node) { MethodBeingVisited = ClassBeingVisited.Methods.Lookup(node.methodName.name); if (node.paramDeclList != null) for (int x = 0; x < node.paramDeclList.paramDeclList.Count; x++) node.paramDeclList.ParamDeclAtIndex(x).Accept(this); if (node.variableDeclList != null) for (int x = 0; x < node.variableDeclList.variableDeclList.Count; x++) node.variableDeclList.VariableDeclAtIndex(x).Accept(this); if (node.statementList != null) for (int x = 0; x < node.statementList.statementList.Count; x++) node.statementList.StatementAtIndex(x).Accept(this); }