You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
COMMENT is defined in the lexer. As a result, the parser has difficulties parsing it's own grammar, in particularly this line: comment = ’(*’, {comment symbol}, ’*)’;
Everything between (* and *) is considered a comment by the lexer. Because the lexer has already matched the comment the parser sees only the rest, which is: comment = ’’;
The solution is to define the comment rule in the parser, and not in the lexer, however it will 'pollute' the grammar with the comment rule everywhere. According the official EBNF grammar, a comment is allowed anywhere outside a <terminal string>, <meta identifier>, <integer> or <special sequence>.
comment = ’(*’, {comment symbol}, ’*)’;
comment symbol = comment | terminal string | special sequence | character;
The text was updated successfully, but these errors were encountered:
igochkov
changed the title
Parsing failes for comment = ’(*’, {comment symbol}, ’*)’;
Parsing fails for comment = ’(*’, {comment symbol}, ’*)’;Jul 4, 2023
COMMENT is defined in the lexer. As a result, the parser has difficulties parsing it's own grammar, in particularly this line:
comment = ’(*’, {comment symbol}, ’*)’;
Everything between
(*
and*)
is considered a comment by the lexer. Because the lexer has already matched the comment the parser sees only the rest, which is:comment = ’’;
The solution is to define the comment rule in the parser, and not in the lexer, however it will 'pollute' the grammar with the comment rule everywhere. According the official EBNF grammar, a comment is allowed anywhere outside a
<terminal string>
,<meta identifier>
,<integer>
or<special sequence>
.The text was updated successfully, but these errors were encountered: