From: joel de guzman (isis-tech_at_[hidden])
Date: 2001-05-30 13:02:40
From: "Larry Evans":
> > Aggregates need not store subjects by value. A reference is fine since
> > know that the subject has a lifetime equal to or greater than the
> > Rules<> are composed by reference in Spirit. I such cases, the aggregate
> > does not own the subject(s).
> This will work for FIRST and NILABLE because they are synthesized
> However, FOLLOW requires an inherited attribute, which can be stored as
> of some type of smart pointer.
pardon my ignorance, but who owns a follow? Rule?
> Also, if references are stored in a rule, then wouldn't this cause a
> Rule1 references Rule2 and Rule2 references Rule1? One or the other
> must be created before a reference can be returned to it. Am I missing
I don't know if this applies in the context of the automata builder.
I am speaking just from experience with Spirit. Rules in Spirit,
just like in c++ need to be declared before being used. To allow
cyclic structures typically found in BNF declarations, a rule
may be declared but defined later (forward declared).
Rule<> a, c;
Rule<> b = c | a;
a = ...
b = ...
In fact, we can just forward declare all rules.
Rule<> a, b, c;
b = c | a;
a = ...
c = ...
Joel de Guzman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk