Skip to content

Comments.sdf3

pdmosses/sdf/org.metaborg.meta.lang.template/syntax/layout/Comments.sdf3

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
module 

imports
  layout/Whitespace

lexical syntax
        LAYOUT = "%%" line:~[\n\r]* LayoutNewlineAlt        {category("Comment")}
         = [\n\r]
         = EOF
    LAYOUT = "%" content:~[\%\n\r]+ "%"        {category("Comment")}
    LAYOUT = "/*" LayoutCommentAlt* "*/" 
    LayoutCommentAlt = ~[\*]
    LayoutCommentAlt = CommentChar
     = [\*]
    LAYOUT = "//" ~[\n\r]* LayoutNewlineAlt
     = 

lexical restrictions

    CommentChar   -/- [\/]

    %% EOF may not be followed by any char

    EOF           -/- ~[]          


context-free restrictions 
    LAYOUT? -/- [\%]
    LAYOUT? -/- [\ \t\n\r]
    LAYOUT? -/- [\/].[\/]
    LAYOUT? -/- [\/].[\*]