Hello!
I am trying to resolve a problem with my grammar for days now, but I still cannot find the solution until now 
Here is a part of the grammar I wrote:
ExprComponentRefOrCall returns Exp::uExp:
{Exp::CALL_INITIAL} 'initial' '(' ')'
| ExprFunctionCall
| ExprComponentRef
;
ExprComponentRef returns Exp::uExp:
{Exp::CREF} componentRef=ComponentRef
;
ExprFunctionCall returns Exp::uExp:
{Exp::CALL} function=ComponentRef '(' functionArgs=FunctionArguments? ')'
;
ComponentRef returns ComponentRef::uComponentRef:
ComponentReferenceQualified
| {ComponentRef::CREF_IDENT} ref=IDENT
;
ComponentReferenceQualified returns ComponentRef::uComponentRef:
{ComponentRef::CREF_QUAL}
ref=IDENT '.' componentRef=ComponentRef
;
FunctionArgumentsNormal returns FunctionArgs::uFunctionArguments :
{FunctionArgs::FUNCTIONARGS} argNames+=NamedArguments (',' argNames+=NamedArguments)*
;
NamedArguments returns NamedArg::uNamedArg :
{NamedArg::NAMEDARG} argName=ComponentRef '=' argValue=INTEGER
;
So, the problem is ExprFunctionCall and ExprComponentRef begins both with a ComponentRef. When I try to generate the files with XText I got an error:
[fatal] rule ruleExprComponentRefOrCall has non-LL(*) decision due to recursive rule invocations reachable from alts 2,3. Resolve by left-factoring or using syntactic predicates or using backtrack=true option.
...normal
Basically, I would be able to write something like:
myVariable
myPackage.myVariable
myFunction()
myFunction(a=1, b=4, c=10)
myFunction(a.b.c=1, b.d=4)
myPackage.myFunction(a.b=1)
etc.
It could be possible (I think) to write something like
ExprComponentRefOrCall:
ComponentRef ( '(' FunctionArguments? ')' )?
;
But since the variables and the functions are represented by differents ECore models (respectively {Exp::CREF} and {Exp::CALL} with different feature names.
Is there any way to resolve this problem or do I need to change my ECore models?
Thank you for your help...