Using Xtext reserved wording withing DSL [message #1792933] |
Thu, 26 July 2018 07:22  |
Christoff Erasmus Messages: 32 Registered: December 2016 |
Member |
|
|
Hello.
Hoping for some advice please.
Currently I am trying to write rules to deal with "Compiler Directives" as defined here.
The basic layout is:
Quote:
'/' directive (directive_options)?
My one of my initial attempts:
>>Insert Screenshot of Grammar Snippet<<<
Quote:
CompilerDirectiveTITLE:
'/TITLE' name=ID
;
CompilerDirectiveEJECT:
{CompilerDirectiveEJECT}
'/EJECT'
;
CompilerDirectiveDEFINE:
'/DEFINE' name=ID
;
CompilerDirectiveUNDEFINE:
'/UNDEFINE' name=ID
;
CompilerDirectiveEOF:
{CompilerDirectiveEOF}
'/EOF'
;
The issue::
When trying to specify the "EOF" directive, the grammer does not compile.
>>>Insert Screenshot of EOF directive<<<
CompilerDirectiveEOF:
{CompilerDirectiveEOF}
'/EOF'
;
>>>Insert Screenshot of MWE2 Error<<<
Parser.g:104:3: The following alternatives can never be matched: 2
Request:
Is it possible to have '/EOF' in the DSL?
EDIT:
Seems that Images are not being uploaded. Replaced with code snippet.
[Updated on: Thu, 26 July 2018 07:32] Report message to a moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01845 seconds