dionyziz/llama — pull request #6 by Renelvon (2014-06-07 22:36:06+00:00)
Title: Separation of Lexer interface and implementation

I splitted class LlamaLexer into classes Lexer (interface) and _LexerBuilder (implementation). It is now possible to construct a complete lexer for llama with one call to Lexer (see main.py).

Issues:
1) The lexer returned from _LexerBuilder is somewhat incomplete; it doesn't conform to the PLY interface.
2) The Lexer class is tightly coupled with the _LexerBuilder class.

Both of these issues can be fixed by making _LexerBuilder produce lexers conforming to the PLY interface. This is not hard; just add the appropriate "@property" decorators to the _LexerBuilder class. However, since Lexer class does that already, there will be some inevitable code duplicaton.