[TCS] Is "autoCreate=ifmissing" usable? [message #613626] |
Thu, 13 March 2008 14:41 |
Guillaume Savaton Messages: 19 Registered: July 2009 |
Junior Member |
|
|
Hi,
I am working on a small example language.
In my TCS syntax, I am trying to use the "autoCreate" parameter like this :
template Program main context
: assignments
;
template Assignment
: variable{refersTo=name, lookIn=owningProgram.variables,
autoCreate=ifmissing} "=" expression ";"
;
When meeting an assigned variable name, the parser creates a new
"Variable" element and correctly sets the "variables" reference in the
surrounding "Program" element.
The problem is that "ifmissing" seems to have the same effect as "always":
if I use the same variable name in several assignments, several variables
with the same name are created.
Since I found no example using "ifmissing", I am wondering whether this
feature has already been used successfully, and how I could get it to work.
Many thanks for your help,
Guillaume
|
|
|
Powered by
FUDForum. Page generated in 0.03377 seconds