Hans,
Expr = 'x' xt:ExprTail? | 'this' tt:ExprTail? | Number nt:ExprTail? | String st: ExprTail?ExprTail = '.' i:Identifier '(' arg:Expr ')' t:ExprTail?
The variables are stored on a stack so that re-entrant rules behave correctly. They are not initialised until the action(s) associated with the rule(s) that succeeded within the entire parse are triggered when the start symbol's rule succeeds. The stack is initialised one element at a time, as each 'named semantic value' is encountered, in the final parse of the input. Earlier actions will leave stuff in the stack that later actions might see if they happen to share the same stack location during the final evaluation of the actions.
The effect that you want might be easily achievable but I'll have to think about it. If something as simple as introducing an implicit action at the start of every rule to clear the stack locations associated with its variables can be shown to be robust then I think it would be worthwhile. Until then assume that every variable contains undefined junk unless its rule is known to have succeeded in the final parse of the input.
Cheers, Ian _______________________________________________ fonc mailing list [email protected] http://vpri.org/mailman/listinfo/fonc
