Description
The lexer class tests and improvements.
Issue 1
Inside the tests, the Lexer.lex method is called in a non static way despite lex being static.
There is no need to create an instance if lex is static.
Issue 2
Consider to use StringBuilder instead of StringBuffer as this will have performance has better performance.
Issue 3
There is an indentation error that you can spot in between lines 46 and 48 of Lexer.class.
Issue 4
Redundant private declaration for TokenType enum.
Description
The lexer class tests and improvements.
Issue 1
Inside the tests, the
Lexer.lexmethod is called in a non static way despitelexbeing static.There is no need to create an instance if lex is static.
Issue 2
Consider to use StringBuilder instead of StringBuffer as this will have performance has better performance.
Issue 3
There is an indentation error that you can spot in between lines 46 and 48 of
Lexer.class.Issue 4
Redundant private declaration for
TokenTypeenum.