[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Wed, 07 May 2003 13:32:57 -0400, Etienne Gagnon wrote:
>I am not sure I understand your request. Can you elaborate on your
>notation and examples of where this would be useful? How would the
>AST nodes naming convention apply?
>Why use the "/" symbol? Wouldn't a new keyword be easier to read and
There are no key words for ?, + or *.
This is in the same style.
I just happened to use / because it was easy.
At first I thought to use \ for right associative but saw that it was unnecessary.
It just reversed the order of the list.
Would S @ T or S # T or S % T be any better?
PARAMETER_LIST = COMMA / PARAMETER;
or would the following be better?
PARAMETER_LIST = PARAMETER # COMMA;
Notice I reversed the notation.
The idea is that a list of something separated by something else
would be easy to specify and produce a compact AST.
A common feature of programming languages.
The naming works the same as for +.
In this case there are two ordered lists. (S and T for the first example).
>Ken Walter wrote:
>> In addition to ? + and *, a useful notation could be "list"
>> of the form something like:
>> E = S / T;
>> which would mean
>> E = T
>> | E S T;
>> This would produce two lists of Ss and Ts.
>> This would automatically take care of what I think is one of the most
>> frequent transforms of the parse tree.
>> Processing the list from one end or the other would take care of
>Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/
All of the above is hearsay.