Пример #1
0
 public virtual void Visit(WorkspaceSyntax pNode)
 {
     foreach (var i in pNode.Imports)
     {
         i.Accept(this);
     }
     foreach (var s in pNode.Structs)
     {
         s.Accept(this);
     }
     foreach (var m in pNode.Methods)
     {
         m.Accept(this);
     }
     foreach (var c in pNode.Casts)
     {
         c.Accept(this);
     }
 }
Пример #2
0
        public virtual SyntaxNode Visit(WorkspaceSyntax pNode)
        {
            List <ImportSyntax> imports = new List <ImportSyntax>(pNode.Imports.Count);

            foreach (var i in pNode.Imports)
            {
                imports.Add(i.Accept <ImportSyntax>(this));
            }

            List <MethodSyntax> methods = new List <MethodSyntax>(pNode.Methods.Count);

            foreach (var m in pNode.Methods)
            {
                methods.Add(m.Accept <MethodSyntax>(this));
            }

            List <CastSyntax> casts = new List <CastSyntax>(pNode.Casts.Count);

            foreach (var c in pNode.Casts)
            {
                casts.Add(c.Accept <CastSyntax>(this));
            }

            List <StructSyntax> structs = new List <StructSyntax>(pNode.Structs.Count);

            foreach (var s in pNode.Structs)
            {
                structs.Add(s.Accept <StructSyntax>(this));
            }

            List <ConstSyntax> consts = new List <Syntax.ConstSyntax>(pNode.Consts.Count);

            foreach (var c in pNode.Consts)
            {
                consts.Add(c.Accept <ConstSyntax>(this));
            }
            return(SyntaxFactory.Workspace(imports, methods, casts, structs, consts).WithAttributes(pNode));
        }