public override object VisitProperty(UHeaderParser.PropertyContext context) { if (Ignore || _currentClass == null) { return(null); } var arrayContext = context.Child <UHeaderParser.IsArrayContext>(); var variable = ParceType(context.type()); variable.AccessModifier = _accessModifier; variable.Default = context.propertyDefaultValue()?.GetText(); variable.Description = _currentComment; variable.IsStatic = context.FoundChild <UHeaderParser.IsStaticContext>(); variable.IsArray = arrayContext != null; variable.Name = context.propertyName().GetText(); variable.UMeta = _currentUMeta ?? variable.UMeta; variable.OwnerClass = _currentClass; if (arrayContext != null && int.TryParse(arrayContext.arrayLen().GetText(), out var arrayLenght)) { variable.ArrayLenght = arrayLenght; } _currentClass.Property.Add(variable); _currentUMeta = null; _currentComment = ""; return(null); }
/// <summary> /// Visit a parse tree produced by <see cref="UHeaderParser.property"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitProperty([NotNull] UHeaderParser.PropertyContext context) { return(VisitChildren(context)); }