Add Lexer

Add a new class for parsing rules in string format.