java - JavaCC not going to next possible token -


i have 2 tokens < import> , <\import>, , need capture data inside tag. i've tried code:

< codigo_java_import_open: "<import>" > < codigo_java_import_close: "<\\import>" >  void insertimportjavacode():{} {     < codigo_java_import_open >     insertimportjavacoderecursiva()  }  void insertimportjavacoderecursiva(): {     token t; } {     (         lookahead(2)         t = < codigo_java_import_close >     |         t = < ~[] >          {             // code use information of token t         }         insertimportjavacoderecursiva()     ) }  

but, javacc goes in first option of insertimportjavacoderecursiva() ex.: if have import code this:

<import>     import there. <\import> 

javacc throw error token "import there." not <\import>.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -