I am rewriting a lexer class that has several "parameters" like whitespaceSplit
.
So it goes this way:
lexer = new Lexer();
lexer.whitespaceSplit = true;
lexer.otherParameter = ...;
lexer.parse(file);
The trouble is that a user of my library could change the parameters such as whitespaceSplit
in the middle of the parsing process and allowing this looks like a code smell for me.
What to do?