| 
| Local Variable in XBlockExpression [message #1424450] | Mon, 15 September 2014 21:28  |  | 
| Eclipse User  |  |  |  |  | Hi, 
 I use XBlockExpression in my xtext grammar but I have a problem. In XBlockExpression I can't create local variable..
 I would like to create and some my functions in XBlockExpression, for example:
 
 {
 ...
 int time = 5
 log("Setting the system time to ", time);
 ...
 }
 
 Is it possible?
 
 I tried example from https://www.eclipse.org/Xtext/7languagesDoc.html#scripting
 
 grammar org.xtext.scripting.Scripting with org.eclipse.xtext.xbase.Xbase
 
 generate scripting "http://www.xtext.org/scripting/Scripting"
 import "http://www.eclipse.org/xtext/xbase/Xbase"
 
 Script returns XBlockExpression:
 {Script}
 (expressions+=XExpressionInsideBlock ';'?)*;
 
 but it doesn't work. There are warning for import "http://www.eclipse.org/xtext/xbase/Xbase" (The imported package is not on the classpath of this project which may lead to follow up errors.) and error for XExpressionInsideBlock (XExpressionInsideBlock cannot be resolved to a rule).
 I included xtend library (there is xbase.lib in this library)
 
 Thank you in advance,
 
 Marko
 |  |  |  | 
|  | 
|  | 
|  | 
Powered by 
FUDForum. Page generated in 0.03668 seconds