| [TCS] Is "autoCreate=ifmissing" usable? [message #613626] | 
Thu, 13 March 2008 10:41  | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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.02739 seconds