+ 1
How to write a lexer in js or c++ ?
I wanna lexer using js code or c++ code. Could anyone help ?
2 odpowiedzi
+ 2
You can just use regular expressions. In JS, create an array of tokens and in C++, create a linked list of tokens.
There are already some tools for this in C++. Look for lex/flex and yacc/bison.
0
I recommend that you watch this: https://www.youtube.com/watch?v=TG0qRDrUPpA