تحسين أداء المرمّز
- The lexer will use a process similar to that of testState in the parser.
- Lexer will only duplicate the state when it really needs to.
- Duplicating the state is done by first use state branching similar to that used in the parser. When we know we want to keep the state we copy the rest of the levels. For more optimization we may reserve the trunk levels but not copy them until the state is to be kept.
- A counter is used to count the branching point in the stack to know if we need to continue move up in the stack looking for a next branching point.