Skip to content

Literals.sdf3

pdmosses/sdf/org.metaborg.meta.lang.template/syntax/literals/Literals.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
module literals/Literals

imports kernel/Kernel 
 constants/StrCon
 constants/IdentifierCon

lexical syntax

    SingleQuotedStrChar.Newline = "\\n"                    
    SingleQuotedStrChar.Tab = "\\t"                   
    SingleQuotedStrChar.Quote = "\\'"           
    SingleQuotedStrChar.Backslash = "\\\\"                    
    SingleQuotedStrChar.Decimal = "\\" a:[0-9]b:[0-9]c:[0-9] 
    SingleQuotedStrChar.Normal = ~[\0-\31\n\t\'\\] 

    SingleQuotedStrCon.Default =  [\'] chars:SingleQuotedStrChar* [\'] 

context-free syntax
        FunctionName.UnquotedFun = <<IdCon>>
        FunctionName.QuotedFun = <<StrCon>>

context-free syntax
        Symbol.Lit = <<string:StrCon>>
        Symbol.CiLit = <<ci-string:SingleQuotedStrCon>>
        //Production.PrefixFun = <<fun:FunctionName>(<arguments:{Symbol ", "}*>) -\> <result:Symbol> <Attributes>>