Пример #1
0
        public void Visit(AST.FieldTypes.InlineObject io)
        {
            StructureBuilder structureBuilder = new StructureBuilder(this.Elements);

            Debug.Assert(!this.Elements.ContainsKey(FieldName), "Crap, we already have a type that has the same name as the field that uses this anonimous type. Typenames should be unique");

            var name = FieldName + "_structurue";

            structureBuilder.BuildStructure(io, name);
            structureBuilder.PopulateStructure(io, name);
            Debug.Assert(this.Elements.ContainsKey(name));
            translated_type = this.Elements[name];
            CheckIfCollection();
        }
Пример #2
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);
         }
     }
 }