Posted By:
franz
Posted On:
Thursday, June 28, 2012 10:02 AM
It's not perfect, but you can give it a try:
grammar Test;
options {
language = Java;
output = AST;
}
rule: OPEN_TAG ANY_CONTENT CLOSE_TAG;
//WS :
// (' ' | '\t' | '\f')+ {$channel=HIDDEN;};
OPEN_TAG:
'<' (options{greedy=false;}: ~'/')* '>';
CLOSE_TAG:
'<' (options{greedy=flase;}: ~'>')* '/>';
ANY_CONTENT:
(~'<')*;
Would be nice to get feedback.
Regards,
Franz