|[Xbase] extending scope for XVariableDeclaration [message #758702]
||Thu, 24 November 2011 10:06
|| Lorenzo Bettini
Registered: July 2009
Location: Firenze, Italy
I'd like to have XVariableDeclarations also in other parts of my DSL
(just to give a possible scenario, say global variables), and I'd like
XExpressions to be able to refer to these variable declarations.
I guess I should extend (and inject) the XbaseScopeProvider.
In Xtext 2.0 documentation there was a paragraph about that
"Populating the Scopes"
for the domainmodel example, but now that paragraph is gone in Xtext 2.1
documentation, and the domainmodel example does not have a custom scope
provider anymore (I guess because now things have changed using the
So is it still the right way to override this method in XbaseScopeProvider?
protected IScope createLocalVarScope(IScope parentScope,
slightly related to this question: in the unit tests for the DSL, since
the custom scoping is not yet implemented I get failures (as expected)
using code like
@Inject ParseHelper<Model> parser
@Inject extension ValidationTestHelper
parser.parse(...my test model...).assertNoErrors
but the test fails with a WrappedException which also says something like
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/Flags
thus the actual linking error is kind of lost in the trace...
it this the expected behavior?
thanks in advance
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
Powered by FUDForum
. Page generated in 0.02091 seconds