Scoping and content assist relation [message #690803] |
Thu, 30 June 2011 04:56  |
Eclipse User |
|
|
|
I have a simple grammar below, but the content assist displays possibilities like 'include' under 'package'. Should I customize content assist or change the scoping? My impression was that scoping only applies to references a given context?
Model:
package=PackageDeclaration;
PackageDeclaration:
'package' name=QualifiedName '{'
elements+=AbstractPackageElement*
'}';
AbstractPackageElement:
ModuleDeclaration | TestDeclaration;
ModuleDeclaration:
'module' name=QualifiedName '{'
properties+=Property* &
elements+=AbstractModuleElement*
'}';
AbstractModuleElement:
Include | PreCompileOption | Type;
Include:
'include' name=STRING;
Feeding this sample input, gives an error "missing '}' at 'module'". Naturally, it should complain about 'include' being in the wrong place.
package myPackge{
include "inc"
module myModule {
}
}
Thanks for helping!
|
|
|
|
|
Re: Scoping and content assist relation [message #690949 is a reply to message #690925] |
Thu, 30 June 2011 08:53  |
Eclipse User |
|
|
|
It's hard to tell what's wrong without your complete grammar. However,
AntlrWorks may help to spot the errors.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
On 30.06.11 14:33, Balazs Varnai wrote:
> Hi Sebastian,
>
> Thanks again! Now I get a lot of warnings like below. I guess my grammar
> smells bad.
>
> Decision can match input such as "'property' RULE_ID RULE_ID" using
> multiple alternatives: 1, 2
> As a result, alternative(s) 2 were disabled for that input
> Semantic predicates were present but were hidden by actions.
>
|
|
|
Powered by
FUDForum. Page generated in 0.05283 seconds