[antlr-interest] Solved problem with matching nested blocks

Liviu U liviu.u at gmail.com
Sat Jul 7 04:45:01 PDT 2007


I fixed the problem ;) .

grammar Test2;

options
{
  backtrack=true;
}

tokens
{
  TK_BLOCK;
}

prog
    :     (ID | block)*;

block
    :    '{'  noblock? (block noblock?)* '}';

noblock
    :    (~('}'|'{'))+;



WS     :     (' '|'\r' | '\n' | '\t' )+ {skip();};
ID     :     'a'..'z'|'A'..'Z';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070707/51424748/attachment-0001.html 


More information about the antlr-interest mailing list