Loading ...
Sorry, an error occurred while loading the content.

1210Re: [json] Stoppable SAX-like interface for streaming input of JSON text

Expand Messages
  • Tatu Saloranta
    Feb 7, 2009
      On Fri, Feb 6, 2009 at 5:33 PM, Fang Yidong <fangyidong@...> wrote:
      >> Maybe, but not necessarily, because this information if implicit
      >> within call stack (except for having to track end markers).
      >> That is, it's a recursive-descent kind of approach where you know
      >> where you came from, usually without additional tracking of location.
      >> Code branches based on constructs encountered.
      > Yes, it's convenient. But I think it may result in a call stack based processor instead of a heap based
      > one, right? The former will cause stack overflow issues in a deep nesting level. Here's a heap

      Yes, if your document has nesting level of about million or so. :-D
      So I don't think that is a practical concern.

      If it happens to be, then one can construct explicit stack, similar to
      how one has to do it with SAX-like interfaces.

      > based processor for building object graph with SAX-like interface:
      > http://code.google.com/p/json-simple/wiki/DecodingExamples#Example_6_-_Build_whole_object_graph_on_top_of_SAX-like_content

      Right: that builds "poor man's object binding", List/Map/primitive
      structure from Json.
      Most Json parsers offer that functionality via API, so it need not be
      built from low-level components (json.org and others).
      Code with pull API would be quite similar, although one could choose
      between recursion and iteration with explicit stack.

      -+ Tatu +-
    • Show all 12 messages in this topic