In article <20030620153706.GA65136 / rysa.inetz.com>,
  why the lucky stiff <ruby-core / whytheluckystiff.net> writes:

> The problem is YAML like this:
>
>   - &a [*a, *a]
>
> As I'm using an LALR grammar, the ALIAS `*a' gets parsed before the
> ANCHOR `&a'.  So `*a' will be a BadAlias node when `&a' gets parsed.

One idea is creating empty array just after the anchor.

object = ...
       | '[' ... ']' { ... }
       | anchor { o = rb_ary_new(); register_ref($1, o); $<value>$ = o; } '[' ... ']' { ... $$ = $<value>2; }
       | ...
       | alias

anchor = '&' name { ... }
alias = '*' name { ... }
-- 
Tanaka Akira