Search code examples
compiler-constructionjavacc

how to use the empty word in JAVACC as a token?


I am setting up a parser using JavaCC and I want to use the empty word as a token (the epsilon word )

I tried to use a non terminal

    void Empty() : 
     {}
     {
     } 

but i am getting an error

i tried a token < EMPTY : "" > nothing worked

I want a token to represent an empty word


Solution

  • I found a solution I used { } and it worked fine