If you have a combined lexer/parser grammar there seems to be no way to specify additional member variables for the lexer like this: grammar XML; { boolean textMode = false; } This is possible only if you split the grammar. Any better solutions? Oliver