The time to build a lexer from scratch is equal to deserializing it in most cases. So a standalone lexer can be built without this class. When needed for a Parser, use the SerializedParser factory!
This factory will separate the passed syntax into parser and lexer syntax if token and ignored symbol Lists are null. So take care to use "token" and "ignored" rules within syntax to achieve the desired result!
Example (syntax input from a file):
File ebnfFile = ...; Lexer lexer = new SerializedLexer().get(ebnfFile);or (syntax input from a Reader, must pass a filename):
Reader ebnfReader = ...; Lexer lexer = new SerializedLexer().get(ebnfReader, "MyLexer.ser");@author (c) 2002, Fritz Ritzberger
|
|
|
|
|
|