private void ApplyVisitor(DeclarationVisitor visitor) { foreach (Declaration declaration in m_Class.Declarations) { declaration.AcceptVisitor(visitor); } }
private static void GetDeclarations(string sourceFileName, IParseTree tree, IEnumerable <Declaration> existingDeclarations, out IEnumerable <Declaration> newDeclarations, out IEnumerable <string> fileTags) { var variableDeclarationVisitor = new DeclarationVisitor(sourceFileName, existingDeclarations); try { variableDeclarationVisitor.Visit(tree); } catch (TypeException e) { throw new TypeException(e.Context, e.InternalMessage, sourceFileName); } // Upon exit, newDeclarations will now contain every variable // declaration we found newDeclarations = variableDeclarationVisitor.NewDeclarations; fileTags = variableDeclarationVisitor.FileTags; }
public override void AcceptVisitor(DeclarationVisitor visitor) { visitor.VisitIntDeclaration(this); }
public abstract void AcceptVisitor(DeclarationVisitor visitor);