Skip to content

WebDSL-Core.sdf3

pdmosses/webdsl-statix/webdslstatix/syntax/WebDSL-Core.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
module 

imports
  WebDSL-Action
  WebDSL-DataModel
  WebDSL-Lexical

context-free sorts

    FunctionSortParams FunctionSortParam FunctionSortReturn OptCallArgs 

context-free syntax %% Types

  .SimpleSort = <<SimpleSortLex>>
  .GenericSort = <<GenericSortLex> \< <{Sort ","}+> \>>
  .ListSort = <[ <Sort> ]>
  .SetSort = <{ <Sort> }>
  .RefSort = <ref <Sort>>
  .RefSortAlt = <Ref \< <Sort> \>>
  .FunctionSort = <function <FunctionSortParams> <FunctionSortReturn>>

lexical syntax

   = "function" {reject}

context-free syntax

  %% function type; optionally specify (named) args and return type
  FunctionSortParams.FunctionSortParams = <( <{FunctionSortParam ","}*> )>
  FunctionSortParams.FunctionSortParamsNone = <>
  FunctionSortParam.UnnamedArg = Sort
  FunctionSortParam.NamedArg = <<VarId> : <Sort>>
  FunctionSortReturn.FunctionSortReturn = <: <Sort>>
  FunctionSortReturn.FunctionSortReturnNone = <>

  .Arg = <<VarId> : <Sort>>
  .FormalArgs = <( <{FormalArg ","}*> )>
  .OptFormalArgsNone = <>

  OptCallArgs.CallArgs = <( <{Exp ","}*> )>
  OptCallArgs.OptCallArgsNone = <>

context-free sorts

  Unit   EnumValue

syntax

  -CF.Section = "section" SectionName-CF LAYOUT?-CF Definition*-CF

context-free syntax

  Unit.ApplicationDefs = <
    application <QId>
      <Definition+>
    <Section*>
  >

  Unit.Application = <
    application <QId>
    <Section*>
  >

  Unit.ModuleDefs = <
    module <ModuleName>
      <Definition+>
    <Section*>
  >

  Unit.Module = <
    module <ModuleName>
    <Section*>
  >

  Unit.BuiltInDefs = <
    built-in
      <Definition+>
    <Section*>
  >

  Unit.BuiltIn = <
    built-in
    <Section*>
  >

  Unit.BuiltInLibraryDefs = <
    built-in-library
      <Definition+>
    <Section*>
  >

  Unit.BuiltInLibrary = <
    built-in-library
    <Section*>
  >

  Unit.EmptyUnit = <>

  .Imports = <
    imports <ImportName>
  >

  .ImportsBuiltIn = <
    imports built-in
  >

  ImportName = "built-in" {reject}

context-free syntax

  .Description = <
    description { <Word*> }
  >
  .Note = <
    note { <Word*> }
  >

  .Enum = <
    enum <Id> {
      <{EnumValue ","}*>
    }
  >
  EnumValue.EnumValue = <<Id> ( <String> )>

context-free sorts

  Action Statement

context-free syntax

   = Action