Пример #1
0
 public MemberValue(JsonSyntaxNode valueNode)
     : base(valueNode)
 {
     this.valueNode = valueNode;
 }
        protected virtual JsonSyntaxNode VisitSyntaxNode(JsonSyntaxNode node)
        {
            foreach (var child in node.GetChildren())
                Visit(child);

            return node;
        }
 public MemberValue(JsonSyntaxNode valueNode)
     : base(valueNode)
 {
     this.valueNode = valueNode;
 }
        public virtual JsonSyntaxNode Visit(JsonSyntaxNode node)
        {
            node.AssertNotNull();

            switch (node.NodeType)
            {
                case JsonSyntaxNodeType.Characters:
                {
                    VisitCharacters(node as Characters);
                    break;
                }
                case JsonSyntaxNodeType.CloseBrace:
                {
                    VisitCloseBrace(node as CloseBrace);
                    break;
                }
                case JsonSyntaxNodeType.CloseBracket:
                {
                    VisitCloseBracket(node as CloseBracket);
                    break;
                }
                case JsonSyntaxNodeType.Colon:
                {
                    VisitColon(node as Colon);
                    break;
                }
                case JsonSyntaxNodeType.Comma:
                {
                    VisitComma(node as Comma);
                    break;
                }
                case JsonSyntaxNodeType.DecimalPoint:
                {
                    VisitDecimalPoint(node as DecimalPoint);
                    break;
                }
                case JsonSyntaxNodeType.Exponentiation:
                {
                    VisitExponentiation(node as Exponentiation);
                    break;
                }
                case JsonSyntaxNodeType.ExponentiationLetter:
                {
                    VisitExponentiationLetter(node as ExponentiationLetter);
                    break;
                }
                case JsonSyntaxNodeType.False:
                {
                    VisitFalse(node as False);
                    break;
                }
                case JsonSyntaxNodeType.Fraction:
                {
                    VisitFraction(node as Fraction);
                    break;
                }
                case JsonSyntaxNodeType.FractionNumber:
                {
                    VisitFractionNumber(node as FractionNumber);
                    break;
                }
                case JsonSyntaxNodeType.Integer:
                {
                    VisitInteger(node as Integer);
                    break;
                }
                case JsonSyntaxNodeType.JsonArray:
                {
                    VisitJsonArray(node as JsonArray);
                    break;
                }
                case JsonSyntaxNodeType.JsonArrayElement:
                {
                    VisitJsonArrayElement(node as JsonArrayElement);
                    break;
                }
                case JsonSyntaxNodeType.JsonArrayElements:
                {
                    VisitJsonArrayElements(node as JsonArrayElements);
                    break;
                }
                case JsonSyntaxNodeType.JsonObject:
                {
                    VisitJsonObject(node as JsonObject);
                    break;
                }
                case JsonSyntaxNodeType.LeftQuote:
                {
                    VisitLeftQuote(node as LeftQuote);
                    break;
                }
                case JsonSyntaxNodeType.MemberValue:
                {
                    VisitMemberValue(node as MemberValue);
                    break;
                }
                case JsonSyntaxNodeType.Negative:
                {
                    VisitNegative(node as Negative);
                    break;
                }
                case JsonSyntaxNodeType.Number:
                {
                    VisitNumber(node as Number);
                    break;
                }
                case JsonSyntaxNodeType.Null:
                {
                    VisitNull(node as Null);
                    break;
                }
                case JsonSyntaxNodeType.ObjectMember:
                {
                    VisitObjectMember(node as ObjectMember);
                    break;
                }
                case JsonSyntaxNodeType.ObjectMembers:
                {
                    VisitObjectMembers(node as ObjectMembers);
                    break;
                }
                case JsonSyntaxNodeType.OpenBrace:
                {
                    VisitOpenBrace(node as OpenBrace);
                    break;
                }
                case JsonSyntaxNodeType.OpenBracket:
                {
                    VisitOpenBracket(node as OpenBracket);
                    break;
                }
                case JsonSyntaxNodeType.RightQuote:
                {
                    VisitRightQuote(node as RightQuote);
                    break;
                }
                case JsonSyntaxNodeType.StringToken:
                {
                    VisitString(node as StringToken);
                    break;
                }
                case JsonSyntaxNodeType.TailJsonArrayElement:
                {
                    VisitTailJsonArrayElement(node as TailJsonArrayElement);
                    break;
                }
                case JsonSyntaxNodeType.TailObjectMember:
                {
                    VisitTailObjectMember(node as TailObjectMember);
                    break;
                }
                case JsonSyntaxNodeType.True:
                {
                    VisitTrue(node as True);
                    break;
                }
                default:
                    throw new NotSupportedException(string.Format("Unrecognized Node Type {0}", node.NodeType.ToString()));
            }

            return node;
        }