Example #1
0
        public DataObject VisitObj(JSONParser.ObjContext context)
        {
            if (context.pair() != null && context.pair().Length > 0)
            {
                DataObject obj = new DataObject();

                foreach (var p in context.pair())
                {
                    if (p.value() != null)
                    {
                        obj.AddField(VisitPair(p));
                    }
                    else
                    {
                        obj.AddField(p.STRING().GetText().Trim('"'), VisitComplex_value(p.complex_value()));
                    }
                }

                return(obj);
            }
            else
            {
                return(new DataObject());
            }
        }
Example #2
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="JSONParser.obj"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitObj([NotNull] JSONParser.ObjContext context)
 {
 }