Missing Rule BEGIN in White-space awareness grammar [message #1839992] |
Sat, 03 April 2021 07:39 |
wings cu Messages: 14 Registered: January 2021 |
Junior Member |
|
|
I am working on a white-space awareness grammar like python dsl. I need to use terminal rule NEXT_LINE as the end of one statement. But I found this approach will make the BEGIN-END indent fail to match.
What can I do to fix this problem?
hidden(WS)
Model:
greetings+=Greeting*;
Greeting:
{Greeting} 'greet' NEXT_LINE
BEGIN
(exp+=ID)*
END
;
terminal BEGIN: 'synthetic:BEGIN'; // increase indentation
terminal END: 'synthetic:END'; // decrease indentation
terminal ID:
'^'?('a'..'z'|'A'..'Z'|'_')('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
terminal NEXT_LINE:
('\n'|'\r')+;
terminal WS:
(' '|'\t')+;
[Updated on: Thu, 08 April 2021 04:28] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03562 seconds