From: Clark C . E. <cc...@cl...> - 2002-04-14 19:27:26
|
On Sun, Apr 14, 2002 at 12:17:09PM -0700, Neil Watkiss wrote: | 1. It's not that simple. The _parser_ lookahead is theoretically | unbounded. For instance, in the following structure stream, the parser | would have to keep the entire tree on the input buffer before knowing | what to report: | | --- #YAML:1.0 | - 1 | - { foo: bar, baz: com }: nya nya! Why? As I see it, as soon as "- " token is received, the parser can send the series-begin event. The problem seems to be with the second line... and we could fix this by making it illegal... [094] nested_keyed_entry(n) ::= inline_leaf_node line_space * keyed_entry_separator value_node(>n) Thus, with this "compressed" version, we could limit the lookahead to exactly one inline_leaf_node. | NAME: Address | HASH: | + NAME: City | SCALAR: string | + NAME: State | SCALAR: string | + NAME: zipcode | SCALAR: integer Interesting idea, although I think a one inline_leaf_node lookahead is probably preferable to introducing yet another indicator. ;) Finding-ballence-is-hardly-yours, Clark |