I have really simple XML (HTML) parsing ANTLR grammar:\[code\]wiki: ggg+;ggg: tag | text;tag: '<' tx=TEXT { System.out.println($tx.getText()); } '>';text: tx=TEXT { System.out.println($tx.getText()); };CHAR: ~('<'|'>');TEXT: CHAR+;\[/code\]With such input: \[code\]"<ggg> fff"\[/code\] it works fine.But when I start to deal with whitespaces it fails. For example:
- \[code\]" <ggg> fff "\[/code\] - fails at beggining
- \[code\]"<ggg> <hhh> "\[/code\] - fails after \[code\]<ggg>\[/code\]
- \[code\]"<ggg> fff "\[/code\] - works fine
- \[code\]"<ggg> "\[/code\] - fails at end