Using javacc can I push some new characters in front of the inputstream ?
for example let’s say that my parser parses the following syntax:
#define Paragraphs "Paragraph+"
#define Volume "(Title,(Chapter,${Paragraphs})+)"
Book=${Volume}+;
How can I tell javacc that its scanner should preprocess ${Volume} to (Title,(Chapter,Paragraph+)+) before invoking the parser ?
Can It be achieved using the MORE statement ?
Thanks
OK, I think I’ve found the solution: Some java statements can be added in the TOKEN section and the current buffer is defined in a StringBuilder named ‘image‘: