@@ -735,7 +735,11 @@ jmh {
735735def grammarWarningAllowList = [
736736 // JJTree copies the options block into the .jj; re-passing -OUTPUT_DIRECTORY on the
737737 // command line makes JavaCC complain that it overrides the in-file value.
738- ~/ ^Warning: .*Command line setting of .* modifies option value in file\. /
738+ ~/ ^Warning: .*Command line setting of .* modifies option value in file\. / ,
739+
740+ // -OUTPUT_DIRECTORY points at a scratch directory that is wiped before every run, so
741+ // JavaCC always announces that it is creating it. Housekeeping, not a grammar problem.
742+ ~/ ^Warning: Output directory .* does not exist\. Creating the directory\. /
739743]
740744
741745def javaccMainClassOverride = project. findProperty(' javaccMainClass' )
@@ -787,6 +791,7 @@ tasks.register('checkGrammarAmbiguity') {
787791 javaExe. absolutePath,
788792 ' -cp' , javaccClasspath. asPath,
789793 mainClass. toString(),
794+ ' -GRAMMAR_ENCODING=UTF-8' ,
790795 " -OUTPUT_DIRECTORY=${ out.absolutePath} " . toString(),
791796 jj. absolutePath)
792797 .directory(out)
@@ -829,8 +834,8 @@ tasks.register('checkGrammarAmbiguity') {
829834 logger. error(" \n ${ offending.join('\n\n')} \n " )
830835 throw new GradleException (
831836 " ${ offending.size()} JavaCC grammar warning(s), ${ conflicts} of them choice " +
832- " conflicts. Resolve the ambiguity or add an explicit LOOKAHEAD to the earlier " +
833- " expansion. Report: ${ report} " )
837+ " conflicts. Resolve the ambiguity or add an explicit LOOKAHEAD to the earlier " +
838+ " expansion. Report: ${ report} " )
834839 }
835840
836841 logger. lifecycle(' Grammar is free of JavaCC choice conflicts.' )
0 commit comments