public void Visit(Document document)
 {
     sb = new StringBuilder();
     sb.AppendLine("IDL Document : ");
     sb.AppendLine("IDL Headers : ");
     sb.AppendLine();
     if (document.Header != null)
     {
         Visit(document.Header);
     }
     sb.AppendLine();
     sb.AppendLine("IDL Definitions : ");
     sb.AppendLine();
     foreach(var definition in document.Definitions)
     {
         if (definition is Struct)
         {
             Visit((Struct)definition);
             sb.AppendLine();
         }
         else if (definition is IntegerEnum)
         {
             Visit((IntegerEnum)definition);
             sb.AppendLine();
         }
         else if (definition is Service)
         {
             Visit((Service)definition);
             sb.AppendLine();
         }
     }
 }
Example #2
0
        public void Visit(Document document)
        {
            foreach (var definition in document.Definitions)
            {
                var csharpType = new CSharpType(documentContext.Namespace, TemplateContextGenerator.MangleCSharpTypeName(definition.Name), csharpNamespace);
                if (definition is Struct)
                {
                    csharpType.IsTripStruct = true;
                }
                else if (definition is IntegerEnum)
                {
                    csharpType.IsTripEnum = true;
                }

                LOG.Debug(string.Format("Registering type '{0}'", csharpType));
                documentContext.TypeRegistry.Add(csharpType);
            }
        }
 public void Visit(Document document)
 {
     foreach (var definition in document.Definitions)
     {
         if (definition is Struct)
         {
             Visit((Struct)definition);
         }
         else if (definition is IntegerEnum)
         {
             Visit((IntegerEnum)definition);
         }
         else if (definition is Service)
         {
             Visit((Service)definition);
         }
     }
 }
Example #4
0
        public void Visit(Document document)
        {
            foreach (var definition in document.Definitions)
            {
                var javaType = new JavaType(documentContext.Namespace, TemplateContextGenerator.MangleJavaTypeName(definition.Name), javaNamespace);
                if (definition is Struct)
                {
                    javaType.IsLeanStruct = true;
                }
                else if (definition is IntegerEnum)
                {
                    javaType.IsLeanEnum = true;
                }

                LOG.Debug(string.Format("Registering type '{0}'", javaType));
                documentContext.TypeRegistry.Add(javaType);
            }
        }