diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg index 6fe64b812..18838152a 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Java/Java.stg @@ -463,7 +463,16 @@ testShiftInRange(shiftAmount) ::= << // produces smaller bytecode only when bits.ttypes contains more than two items bitsetBitfieldComparison(s, bits) ::= <% -( - })> && ((1L \<\< ( - )) & ( - ))}; separator=" | ">)) != 0) +(})> && ((1L \<\< ) & ()}; separator=" | ">)) != 0) +%> + +isZero ::= [ +"0":true, +default:false +] + +offsetShift(shiftAmount, offset) ::= <% +( - ) %> // produces more efficient bytecode when bits.ttypes contains at most two items