Skip to content
Discussion options

You must be logged in to vote

Compared to Xtext, Langium has a slightly different implementation for the ! terminal element. See also #681. In your case, it leads to an infinite recursion while lexing. You just need to change these terminals:

terminal CHARCONST:	('u'|'U'|'L')? "'" ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|"'") )* "'";
terminal ENCSTRINGCONST	:	('u8'|'u'|'U'|'L') '"' ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|'"') )* '"';

to:

terminal CHARCONST:	('u'|'U'|'L')? "'" ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | /[^\\']/ )* "'";
terminal ENCSTRINGCONST	:	('u8'|'u'|'U'|'L') '"' ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | /[^\\"]/ )* '"';
  1. We directly…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cdietrich
Comment options

cdietrich Feb 27, 2023
Collaborator Author

Answer selected by cdietrich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants