Replies: 1 comment
-
D'oh, it seems
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I want to detect both closed strings (such as
'hello'
) and unclosed strings (such as'hello
, note the missing'
). These lines cannot span on multiple lines.I am using a lexer such as this:
This lexer properly detects
CLOSED_STRING
tokens, but gets confused inUNCLOSED_STRING
tokens.Here's a parser:
And a sample text input:
I tried this at http://lab.antlr.org/ and the parser seems to work properly, but the second token is not recognized:
Any ideas on how to make this working? Any way to improve the lexer rules?
Beta Was this translation helpful? Give feedback.
All reactions