nubitol
High Supremacy Member
- Joined
- Jun 28, 2015
- Messages
- 27,488
- Reaction score
- 632
or I think its called lexer?
the logic is for each character of the content of a file, determine the token, such as
1. matching ) of a ( while inside can contain another (
2. no count for ) that is inside of a string/comment, while comment can be // /* or --
3. when no 2 is inside a string, the string may contain string enclosure such as " or ' that is escaped, the lexer need to know whether it is an escaped enclosure instead of enclosure itself
this kind of programming sounds fun
the logic is for each character of the content of a file, determine the token, such as
1. matching ) of a ( while inside can contain another (
2. no count for ) that is inside of a string/comment, while comment can be // /* or --
3. when no 2 is inside a string, the string may contain string enclosure such as " or ' that is escaped, the lexer need to know whether it is an escaped enclosure instead of enclosure itself
this kind of programming sounds fun

use while with else