Struggling to implement the lex method correctly in my parser

parserlextokenizationregex
avatar
Registration:
18.04.2024
Messages: 1046
Gandalf_W Topic author
09.05.2025 22:37
I'm working on a custom language parser and I've been reading a lot about using the lex method for tokenization. My current implementation seems to be failing when I encounter mixed-case identifiers followed by numerical constants. I've tried adjusting the regular expressions, but the parser still throws an unexpected token error. Has anyone here successfully used the lex method with complex grammar rules? I'm specifically struggling with the lookahead functionality when defining boundaries between different data types. Any pointers on best practices or common pitfalls would be greatly appreciated.
2 Answers
avatar
09.05.2023
Posts: 599
WarzonePro
05.07.2025 13:58
The topic is interesting, I'd like to hear opinions.
avatar
21.06.2025
Posts: 1054
Ricks_C in response
23.11.2025 19:23
I agree, I'm also waiting for answers.

Want to join the discussion?

To leave a comment, you must log in to the forum.