new-javacc commented on issue #1324:
URL: https://github.com/apache/jena/issues/1324#issuecomment-1177743061
The main issue is this is a corner case and doesn't make sense to penalize
the normal cases. So you have two options
1. Edit the generated file and make it the way you want - javacc doesn't
overwrite existing files. It's a "feature" if you will but probably looks like
a hack to the modern developers :)
2. Use the USER_CHARSTREAM option and implement your own charstream - based
on the default one.
But like I originally said, it's best more performant to use lexicla states.
For example if it's triple quoted and you don't allow triple quotes in the
literal, you can use lexical states and do:
<DEFAUL> MORE: { "'''" : QUOTED_CONTENT }
<QUOTED_CONTENT> TOKEN : { <TRIPLE_QUOTED_LITERAL: "'''> : DEFAU:T }
<QUOTED_CONTENT> MORE : { <~[]> }
That just keeps building your literal without actually affecting the
chrastream. The performance difference could be huge here - like 10x even. So I
suggest doinf that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]