1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
%%%
%% Section 3.10.6: Escape Sequences for Character and String Literals
%%
%% @author Martin Bravenboer <martin@cs.uu.nl>
%%%
module languages/java-14/lexical/literals/EscapeSequences
imports
exports
sorts
EscapeSeq
NamedEscape
OctaEscape
LastOcta
syntax
OctaEscape -> EscapeSeq
NamedEscape -> EscapeSeq
"\\" [btnfr\"\'\\] -> NamedEscape {cons("NamedEscape")}
"\\" LastOcta -> OctaEscape {cons("OctaEscape1")}
"\\" [0-7] LastOcta -> OctaEscape {cons("OctaEscape2")}
"\\" [0-3] [0-7] [0-7] -> OctaEscape {cons("OctaEscape3")}
[0-7] -> LastOcta
restrictions
LastOcta -/- [0-7]
|