Esempio n. 1
0
 public override void EnterObject(IddParser.ObjectContext context)
 {
     currentObject        = new IdfObject();
     _inExtensibleSection = false;
     _currentFieldIndex   = -1;
     currentObject.Name   = context.object_header().OBJECT_NAME().GetText().Trim();
     // The plus 1 is for the 'terminating' field.
     currentObject.TotalNumberOfDefinedFields = context.fields().field().Length + 1;
 }
Esempio n. 2
0
 public override void EnterObject(IddParser.ObjectContext context)
 {
     foreach (IddParser.FieldContext field in context.fields().field())
     {
         var properties = field.field_properties().field_property();
         foreach (var prop in properties)
         {
             if (prop.REFERENCE_CLASS_NAME_STATEMENT() != null)
             {
                 var referenceClassName = prop.REFERENCE_CLASS_NAME_STATEMENT().GetText().Substring(22).Trim();
                 if (!ReferenceClasses.ContainsKey(referenceClassName))
                 {
                     ReferenceClasses[referenceClassName] = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
                 }
                 ReferenceClasses[referenceClassName].Add(context.object_header().OBJECT_NAME().GetText().Trim());
             }
         }
     }
 }
Esempio n. 3
0
 public override void ExitObject(IddParser.ObjectContext context)
 {
     allObjects.Add(currentObject);
     Builder.Append($"            {{\"{currentObject.Name}\", () => {currentObject.WriteObjectConstructor()} }},\n");
 }
Esempio n. 4
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="IddParser.object"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitObject([NotNull] IddParser.ObjectContext context)
 {
 }