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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
%%%
%% Section 3.7: Comments
%%
%% @author Martin Bravenboer <martin@cs.uu.nl>
%%%
module languages/java-15/lexical/Comments
imports
languages/java-15/lexical/LineTerminators
exports
sorts
Comment
EOLCommentChars
CommentPart
UnicodeEscape
BlockCommentChars
Asterisk
EscEscChar
EscChar
lexical syntax
Comment -> LAYOUT
"//" EOLCommentChars LineTerminator -> Comment
~[\n\13]* -> EOLCommentChars
"/*" CommentPart* "*/" -> Comment
"/**" CommentPart* "*/" -> Comment
"/**/" -> Comment %% Strange javadoc comment
BlockCommentChars -> CommentPart
EscChar -> CommentPart
EscEscChar -> CommentPart
Asterisk -> CommentPart
UnicodeEscape -> CommentPart
~[\*\\]+ -> BlockCommentChars
"*" -> Asterisk
"\\\\" -> EscEscChar
"\\" -> EscChar
"\\" [u]+ [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] -> UnicodeEscape
lexical restrictions
"/**" -/- [\/]
"/*" -/- [\*]
Asterisk -/- [\/]
EscChar -/- [\\u]
BlockCommentChars -/- ~[\*\\]
EOLCommentChars -/- ~[\n\13]
context-free restrictions
LAYOUT? -/- [\/].[\*]
LAYOUT? -/- [\/].[\/]
|