Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: §wip/metasyntax/sdf-sdf/extracted
Source used for this grammar: Jurgen Vinju, Rob Economopoulos, Bert Lisser, Paul Klint, sdf2/syntax/*.sdf
, February 2006 – July 2010
Grammar
, Alias
, Aliases
, Symbol
, CharRange
, CharRanges
, OptCharRanges
, CharClass
, Character
, ATermAttribute
, Attribute
, Attributes
, Production
, Productions
, Label
, FunctionName
, Definition
, Module
, Section
, Sections
, ModuleName
, ImpSection
, Imports
, Import
, Associativity
, ArgumentIndicator
, Group
, Priority
, Priorities
, Renamings
, Renaming
, Lookahead
, Lookaheads
, Restriction
, Restrictions
, SDF
, Symbols
), 0 root (—), 1 top (SDF
), 9 bottom (Sort
2, NumChar
, ShortChar
, StrCon
4, IdCon
2, ModuleId
2, SingleQuotedStrCon
, NatCon
2, ATerm
).[arrow]
, [alias]
, [list]
14, [start]
, [end]
, [left]
9, [right]
9, [aterm]
, [result]
2, [left-quote]
, [right-quote]
, [string]
, [ci-string]
, [fun]
, [arguments]
4, [params]
, [head]
3, [tail]
2, [sep]
2, [rest]
, [results]
, [from]
, [to]
, [from-prod]
, [to-prod]
, [parameters]
.Grammar ::=
"aliases" Aliases
Alias ::=
Symbol [arrow]::"->" [alias]::Symbol
Aliases ::=
[list]::Alias
Grammar ::= "lexical" "syntax" Productions
Grammar ::= "context-free" "syntax" Productions
Grammar ::=
"variables" Productions
Grammar ::= "lexical" "variables" Productions
Symbol ::= "<" Symbol "-CF" ">"
Symbol ::= "<" Symbol "-LEX" ">"
Symbol ::= "<" Symbol "-VAR" ">"
Symbol ::=
"LAYOUT"
Symbol ::= CharClass
CharRange ::= Character
CharRange ::=
[start]::Character "-" [end]::Character
CharRanges ::= CharRange
CharRanges ::= [left]::CharRanges [right]::CharRanges
CharRanges ::= "(" CharRanges ")"
OptCharRanges ::= ε
OptCharRanges ::= CharRanges
CharClass ::= "[" OptCharRanges "]"
CharClass ::=
"~" CharClass
CharClass ::=
[left]::CharClass "/" [right]::CharClass
CharClass ::=
[left]::CharClass "/\" [right]::CharClass
CharClass ::=
[left]::CharClass "/" [right]::CharClass
CharClass ::= "(" CharClass ")"
Character ::= NumChar
Character ::= ShortChar
Character ::=
"TOP"
Character ::=
"EOF"
Character ::=
"BOT"
Character ::=
"LABEL_START"
Grammar ::=
"(/)"
Grammar ::= [left]::Grammar [right]::Grammar
Grammar ::= "(" Grammar ")"
ATermAttribute ::= [aterm]::ATerm
Attribute ::= ATermAttribute
Attributes ::= "{" [list]:: Attribute "," Attribute "}"
Attributes ::= ε
Production ::=
Symbols "->" [result]::Symbol Attributes
Productions ::=
[list]::Production
Grammar ::=
"syntax" Productions
Label ::= StrCon
Label ::= IdCon
Symbol ::=
Label ":" Symbol
Symbol ::= [left-quote]::"`" Symbol [right-quote]::"`"
FunctionName ::= IdCon
FunctionName ::= StrCon
Symbol ::= [string]::StrCon
Symbol ::= [ci-string]::SingleQuotedStrCon
Production ::= [fun]::FunctionName "(" [arguments]:: Symbol "," Symbol ")" "->" [result]::Symbol Attributes
Definition ::=
[list]::Module
Module ::= "module" ModuleName [list]::ImpSection Sections
Section ::=
"exports" Grammar
Section ::=
"hiddens" Grammar
Sections ::=
[list]::Section
ModuleName ::= ModuleId
ModuleName ::= ModuleId "[" [params]::Symbols "]"
Attribute ::= "id" "(" ModuleName ")"
ImpSection ::=
"imports" [list]::Imports
Grammar ::= ImpSection
Imports ::=
[list]::Import
Import ::= ModuleName
Import ::= ModuleName Renamings
Import ::= "(" Import ")"
Associativity ::=
"left"
Associativity ::=
"right"
Associativity ::=
"non-assoc"
Associativity ::=
"assoc"
Attribute ::=
"bracket"
Attribute ::= Associativity
ArgumentIndicator ::= "<" [arguments]:: NatCon "," NatCon ">"
Group ::= Group ArgumentIndicator
Group ::=
Group "."
Group ::= Production
Group ::= "{" Productions "}"
Group ::= "{" Associativity ":" Productions "}"
Priority ::= [list]::">" GroupGroup
Priority ::= [left]::Group Associativity [right]::Group
Priorities ::= [list]::"," PriorityPriority
Grammar ::=
"priorities" Priorities
Symbol ::= "(" ")"
Symbol ::= "(" [head]::Symbol [tail]::Symbol ")"
Symbol ::=
Symbol "?"
Symbol ::=
Symbol "+"
Symbol ::=
Symbol "*"
Symbol ::= "{" Symbol [sep]::Symbol "}" "+"
Symbol ::= "{" Symbol [sep]::Symbol "}" "*"
Symbol ::= "<" [head]::Symbol "," [rest]:: Symbol "," Symbol ">"
Symbol ::= "(" [arguments]::Symbols "=>" [results]::Symbol ")"
Symbol ::=
[left]::Symbol "|" [right]::Symbol
Symbol ::= "(" [left]::Symbol "->" [right]::Symbol ")"
Symbol ::=
Symbol "?"
Symbol ::=
Symbol "*"
Symbol ::=
Symbol "+"
Renamings ::= "[" [list]::Renaming "]"
Renaming ::=
[from]::Symbol "=>" [to]::Symbol
Renaming ::=
[from-prod]::Production "=>" [to-prod]::Production
Lookahead ::= CharClass
Lookahead ::=
[head]::CharClass "." [tail]::Lookaheads
Lookaheads ::= Lookahead
Lookaheads ::=
[left]::Lookaheads "|" [right]::Lookaheads
Lookaheads ::= "(" Lookaheads ")"
Lookaheads ::= "[[" [list]:: Lookahead "," Lookahead "]]"
Restriction ::=
Symbols "-/-" Lookaheads
Restrictions ::=
[list]::Restriction
Grammar ::=
"restrictions" Restrictions
Attribute ::=
"reject"
Attribute ::=
"prefer"
Attribute ::=
"avoid"
Symbol ::=
"<START>"
Symbol ::=
"<Start>"
Grammar ::= "lexical" "priorities" Priorities
Grammar ::= "context-free" "priorities" Priorities
Grammar ::= "lexical" "restrictions" Restrictions
Grammar ::= "context-free" "restrictions" Restrictions
SDF ::=
"definition" Definition
ModuleName ::=
"aliases"
ModuleName ::=
"lexical"
ModuleName ::=
"priorities"
ModuleName ::=
"context-free"
ModuleName ::=
"definition"
ModuleName ::=
"syntax"
ModuleName ::=
"variables"
ModuleName ::=
"module"
ModuleName ::=
"imports"
ModuleName ::=
"exports"
ModuleName ::=
"hiddens"
ModuleName ::=
"left"
ModuleName ::=
"right"
ModuleName ::=
"assoc"
ModuleName ::=
"non-assoc"
ModuleName ::=
"bracket"
ModuleName ::=
"sorts"
ModuleName ::=
"bracket"
ModuleName ::=
"sorts"
ModuleName ::=
"restrictions"
Symbols ::= StrCon "(" [arguments]:: Symbol "," Symbol ")"
Label ::= Associativity
ATermAttribute ::= Associativity
ATermAttribute ::=
"reject"
ATermAttribute ::=
"prefer"
ATermAttribute ::=
"avoid"
ATermAttribute ::=
"bracket"
ATermAttribute ::= "id" "(" ModuleName ")"
Symbol ::=
"<START>"
Symbol ::=
"<Start>"
Grammar ::= "lexical" "priorities" Priorities
Grammar ::= "context-free" "priorities" Priorities
Grammar ::= "lexical" "restrictions" Restrictions
Grammar ::= "context-free" "restrictions" Restrictions
SDF ::=
"definition" Definition
Symbol ::= Sort
Symbol ::= Sort "[[" [parameters]:: Symbol "," Symbol "]]"
Grammar ::=
"sorts" Symbols
Grammar ::=
"start-symbols" Symbols
Grammar ::= "lexical" "start-symbols" Symbols
Grammar ::= "context-free" "start-symbols" Symbols
Symbol ::= "(" Symbol ")"
Symbols ::=
[list]::Symbol