This is an optional functionality of Lexer. It is
NOT called by the Parser. It can be used to run a standalone Lexer with a LexerSemantic, processing a ready-scanned syntax tree. Other than with Parser Semantic no value stack is available for LexerSemantic, and all input will have been read when LexerSemantic is called with the built syntax tree.
The passed LexerSemantic will receive every matched rule (top-down) together with its results ResultTree, containing the range within input. ResultTree can be converted to text by calling
resultTree.toString().
This method evaluates the input using end-of-input like a parser, that means it returns false if the input was either syntactically incorrect or EOF was not received when all rules have been evaluated.
MIND: This method does not call any TokenListener, as the LexerSemantic is expected to dispatch results!
@param lexerSemantic the LexerSemantic to be called with every evaluated Rule and its lexing ResultTree.
@return true when lexer succeeded (input was syntactically ok), else false.