[antlr-interest] to antlr experts, is this posible
pepone pepone
pepone.onrez at gmail.com
Mon Apr 24 20:20:36 PDT 2006
can i have all this sentences as valid
sentence_1
---
<p>this is a paragraph [[ --- </p>
---
sentence_2
---
<p>[[www.google.com|this ---> is a link inside a paragrph</p>
//Parser rules
document: DOC_TAG (paragraph)* DOC_TAG;
paragraph: OPARA PCDATA|wiki CPARA;
wiki: OWIKI WORD (SEPARATOR WORD)? CWIKI
//Lexer rules
DOC_TAG:"---";
OPARA:<p>;
CPARA:</p>;
OWIKI:"[[";
CWIKI:"]]";
SEPARATOR:'|';
WORD: ('a'...'z')+
how define PCDATA to match both senteces, if found "[[" but not "]]"
don't call wiki and, ignore "---" inside paragraph or wiki
Thanks
--
play tetris http://pepone.on-rez.com/tetris
run gentoo http://gentoo-notes.blogspot.com/
More information about the antlr-interest
mailing list