Example #1
0
 private void FirstPass(AST.Parser AST)
 {
     // So the idea is that we build up a list of structures and enumerations here based on their name. So we are only bothered with 'root level' structures and enumerations
     foreach (var element in AST.Elements)
     {
         Debug.Assert(element is AST.Enumeration || element is AST.Object);
         if (element is AST.Enumeration)
         {
             enumBuilder.Build(element as AST.Enumeration);
         }
         else
         {
             structureBuilder.BuildStructure(element as AST.Object);
         }
     }
 }
Example #2
0
        public void Build(AST.Parser AST)
        {
            FirstPass(AST);

            foreach (var element in AST.Elements)
            {
                VisitElement((dynamic)element);
            }

            // TODO: temporary hack to support old interface
            foreach (var element in elements.Values)
            {
                if (element is Structure)
                {
                    Structures.Add((dynamic)element);
                }
                else
                {
                    Enumerations.Add((dynamic)element);
                }
            }
        }