Hello everyone! I'm kinda lost and dont know where to start. We are asked to make a compiler and the first part would be the lexical analyzer. I search the net and found out that it would be a program that would give tokens to a series of words, characters or any combination of both provided what you intend it to do.
Ok, what if for example I have 6 token categories:
1. Reserved words : pre defined
2. Operators : +/- etc
3. Variables :
4. Strings : all statements enclosed with ' or "
5. invalid statement :invalid
6. numbers : ex. 3, 3.1
How do i check a certain user input that would recognize if the series of inputs are: reserved words, operators, etc. I dont really know where to start... This is to be done in C++ btw. If you happen to know how or know any good links that could help would be greatly appreciated. Thanks!