I am using JavaCC utility to generate a parser. Now I am writing the grammar in ".JJ" file.
I have three tokens defined say TokenA: "A", TokenB: "B" and TokenC: "C".
I have to write a statement in my grammar(.JJ file) such that it should match the above tokens with the following all conditions,
1) All the tokens are optional
Example : ABC or AB or Ac or A or nothing
2)The tokens can appear in any order
Example: ABC or CBA or ACB or .....
3) A token can appear only once
Example: AAB ---> is wrong, becaue "A" appears twice.
Expecting an early reply...
Thanx in advance....