You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use the latest JAVA g4 file from ANTLR4 grammar depot
comment out java action part for unicode
fragment
JavaLetter
: [a-zA-Z$_] // these are the "java letters" below 0xFF
// | // covers all characters above 0xFF which are not a surrogate
// ~[\u0000-\u00FF\uD800-\uDBFF]
// {Character.isJavaIdentifierStart(_input.LA(-1))}?
// | // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
// [\uD800-\uDBFF] [\uDC00-\uDFFF]
// {Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
;
fragment
JavaLetterOrDigit
: [a-zA-Z0-9$_] // these are the "java letters or digits" below 0xFF
// | // covers all characters above 0xFF which are not a surrogate
// ~[\u0000-\u00FF\uD800-\uDBFF]
// {Character.isJavaIdentifierPart(_input.LA(-1))}?
// | // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
// [\uD800-\uDBFF] [\uDC00-\uDFFF]
// {Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
;
- change type to datatype to avoid conflict with python keyword.
add function to print the original text (including hidden channel)
defgetAllText(self, ctx): # include hidden channeltoken_stream=ctx.parser.getTokenStream()
lexer=token_stream.tokenSourceinput_stream=lexer.inputStreamstart=ctx.start.startstop=ctx.stop.stopreturninput_stream.getText(start, stop)