I try to parse this piece of text
:20: test :254: aapje :21: rest ...
:21: are special tags, because they start the line.
:254: should be 'normal' text, as it does not start on a newline.
I would like the result to be
(20, 'test :254: \naapje') (21, 'rest')
Lines are terminated using either
\r\n or '\n'
I started out trying to ignore the whitespace, but then I match the ':254:' tag as well. So I have to create something that uses the whitespace information.
What I would like to be able to do is something like this:
lexer grammar MT9740_lexer; InTagNewLine : '\r\n' ~':'; ReadNewLine :'\r\n' ;
But the first would consume the
: How can I still generate these tokens? Or is there a smarted approach?