|
|
|
|
|
Re: Trigger validator(builder) for multiple files [message #1850486 is a reply to message #1850485] |
Fri, 04 March 2022 16:42   |
Marvin Dongus Messages: 8 Registered: February 2022 |
Junior Member |
|
|
Hi,
they are both building correct. The only problems occur in the context of the cross references. If both files are edited and saved the cross references working fine. If on is unedited the cross references can't be found.
Grammar:
My grammar have two main branches, a programm description or a class definition.
In the programm description class methodes can be called. A scopeProvider provide the method names for the dotExpression. The classes und the methods are defined in a seperated file.
The two brances of the Grammar:
Programm:
(programm = Programmdefinition) | (classDefinitions += ClassDefinition)
;
ClassDefinition:
'define' 'class' name=ID
'{'
classBody += ClassBody;
'}'
;
ClassBody:
DefineClassFunction | .... | ClassDefinition
;
DefineClassFunction
'define' 'Function' returnType = ( Datatype | 'void') name = ID '(' ... ')'
'{'
...
'}'
;
Programmdefinition:
'call' 'Function' ref = FunctionDotExpression '(' ... ')'
;
FunctionDotExpression returns Ref:
ClassRef ({FunctionDotExpression .ref=current} "." tail=[DefineClassFunction])*
;
ClassRef returns Ref:
{ClassRef } ClassRef =[ClassDefinition]
;
The site where i got my ScopeProvider. (I have done some slightly canges for my application): https://dietrich-it.de/xtext/2013/05/18/xtext-and-dot/path-expressions/
[Updated on: Fri, 04 March 2022 16:42] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02535 seconds