Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » variable should visible to only in present function.
variable should visible to only in present function. [message #1048193] Wed, 24 April 2013 06:37
vyv vyv is currently offline vyv vyvFriend
Messages: 3
Registered: April 2013
Junior Member

My output file:

reg1 {
field a field b

reg2 {
field c field d

FOREACH ( X IN reg1 ) {
X . a

FOREACH ( Y IN reg2 ) {

Now after this if I do ctrl+space I will expect only Y should pop-up. But X and Y both are getting pop-up.
How to restrict X to first FOREACH loop? out of first FOREACH loop X and its value should be erased. Please anyone suggest me how to implement this?

The related grammar rule is:

name=ID "{"
"field" name=ID
"FOREACH" var=conds "{"
varref=[cond] "." attr=[Attr]
"(" cond1=cond ")"
| "," cond2=cond
name=ID "IN" entity=[Entity]

public class MyDslScopeProvider extends AbstractDeclarativeScopeProvider {
IScope scope_Use_attr(Use ctx , EReference ref) {
return Scopes.scopeFor(ctx.getVarref().getEntity().getAttributes());

Previous Topic:How to manufacture model elements
Next Topic:Different project with different extension classes
Goto Forum:

Current Time: Wed Sep 30 23:34:06 GMT 2020

Powered by FUDForum. Page generated in 0.01912 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top