Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: §wip/metasyntax/sdf-rascal/extracted
Source used for this grammar: Arnold Lankamp, Jurgen Vinju, lang::sdf2::syntax::Sdf2
, 2010–2013 [GitHub]
Grammar
, Restrictions
, Priority
, Section
, Import
, Attrs
, Imports
, Sections
, Annotation
, ATermAttribute
, Module
, ATerm
, OptExp
, Character
, Label
, SDF
, Lookaheads
, Aliases
, Group
, Prods
, Range
, Renaming
, Class
, ImpSection
, Sym
, RealCon
, Lookahead
, Priorities
, FunctionName
, Restriction
, Syms
, Prod
, ModuleName
, Assoc
, ArgumentIndicator
, IntCon
, Definition
, Alias
, AFun
, Attribute
, Renamings
), 0 root (—), 2 top (SDF
, FunctionName
), 8 bottom (Sort
2, NumChar
, ShortChar
, StrCon
4, IdCon
, ModuleId
, SingleQuotedStrCon
, NatCon
5).[ContextFreePriorities]
, [ImpSection]
, [KernalStartSyms]
, [Aliases]
, [Variables]
, [ContextFreeSyntax]
, [LexicalRestrictions]
, [Sorts]
, [ContextFreeStartSyms]
, [Syntax]
, [Restrictions]
, [Priorities]
, [LexicalStartSyms]
, [LexicalVariables]
, [ContextFreeRestrictions]
, [LexicalPriorities]
, [LexicalSyntax]
, [Default]
4, [Chain]
, [Assoc]
3, [Exports]
, [Hiddens]
, [Bracket]
5, [Module]
2, [RenamedModule]
, [Attrs]
, [NoAttrs]
, [Real]
, [Appl]
, [Annotated]
, [Placeholder]
, [Int]
, [Fun]
, [List]
2, [Present]
, [Absent]
, [eof]
, [short]
, [Numeric]
, [top]
, [label_start]
, [bot]
, [IdCon]
, [Quoted]
2, [def]
, [Definition]
, [Single]
, [Alt]
2, [NonTransitive]
, [AssocGroup]
, [WithArguments]
, [SimpleGroup]
, [ProdsGroup]
, [Range]
, [production]
, [Sym]
, [SimpleCharClass]
, [Comp]
, [Diff]
, [ISect]
, [Union]
, [Imports]
, [Empty]
, [Lit]
, [Opt]
, [Seq]
2, [CILit]
, [Varsym]
, [Sort]
, [Lex]
, [Layout]
, [CF]
, [ParameterizedSort]
, [IterStar]
, [IterStarSep]
, [Iter]
, [Class]
2, [IterSep]
, [Label]
, [RealCon]
, [class]
2, [las]
, [QuotedFun]
, [UnquotedFun]
, [Follow]
, [Prod]
, [id]
, [actuals]
, [Parameterized]
, [Unparameterized]
, [NonAssoc]
, [Left]
, [Right]
, [Negative]
, [Natural]
, [Positive]
, [modules]
, [Alias]
, [Unquoted]
, [Term]
, [Id]
, [Avoid]
, [Prefer]
, [Reject]
, [Renamings]
.Grammar ::= [ContextFreePriorities]::"context-free" "priorities" Priorities
Grammar ::= [ImpSection]::ImpSection
Grammar ::= [KernalStartSyms]::"start-symbols" Syms
Grammar ::= [Aliases]::"aliases" Aliases
Grammar ::= [Variables]::"variables" Prods
Grammar ::= [ContextFreeSyntax]::"context-free" "syntax" Prods
Grammar ::= [LexicalRestrictions]::"lexical" "restrictions" Restrictions
Grammar ::= [Sorts]::"sorts" Syms
Grammar ::= [ContextFreeStartSyms]::"context-free" "start-symbols" Syms
Grammar ::= [Syntax]::"syntax" Prods
Grammar ::= [Restrictions]::"restrictions" Restrictions
Grammar ::= [Priorities]::"priorities" Priorities
Grammar ::= [LexicalStartSyms]::"lexical" "start-symbols" Syms
Grammar ::= [LexicalVariables]::"lexical" "variables" Prods
Grammar ::= [ContextFreeRestrictions]::"context-free" "restrictions" Restrictions
Grammar ::= [LexicalPriorities]::"lexical" "priorities" Priorities
Grammar ::= [LexicalSyntax]::"lexical" "syntax" Prods
Restrictions ::=
[Default]::Restriction
Priority ::= [Chain]::">"Group
Priority ::= [Assoc]::Group Assoc Group
Section ::= [Exports]::"exports" Grammar
Section ::= [Hiddens]::"hiddens" Grammar
Import ::= [Bracket]::"(" Import ")"
Import ::= [Module]::ModuleName
Import ::= [RenamedModule]::ModuleName Renamings
Attrs ::= [Attrs]::"{" Attribute "," "}"
Attrs ::= [NoAttrs]::ε
Imports ::=
Import
Sections ::=
Section
Annotation ::= [Default]::"{" ATerm "," "}"
ATermAttribute ::= [Default]::ε
Module ::= [Module]::"module" ModuleName ImpSection Sections
ATerm ::= [Real]::RealCon
ATerm ::= [Appl]::"(" ATerm "," ")"AFun
ATerm ::= [Annotated]::ATerm Annotation
ATerm ::= [Placeholder]::"<" ATerm ">"
ATerm ::= [Int]::IntCon
ATerm ::= [Fun]::AFun
ATerm ::= [List]::"[" ATerm "," "]"
OptExp ::= [Present]::"e" IntCon
OptExp ::= [Absent]::ε
Character ::=
[eof]::"\EOF"
Character ::= [short]::ShortChar
Character ::= [Numeric]::NumChar
Character ::=
[top]::"\TOP"
Character ::=
[label_start]::"\LABEL_START"
Character ::=
[bot]::"\BOT"
Label ::= [IdCon]::ε
Label ::= [Quoted]::StrCon
SDF ::= [Definition]::"definition" [def]::Definition
Lookaheads ::= [Single]::Lookahead
Lookaheads ::= [Alt]::"|" LookaheadsLookaheads
Lookaheads ::= [List]::"[[" Lookahead "," "]]"
Lookaheads ::= [Bracket]::"(" Lookaheads ")"
Aliases ::=
Alias
Group ::= [NonTransitive]::"."Group
Group ::= [AssocGroup]::"{" Assoc ":" Prods "}"
Group ::= [WithArguments]::Group ArgumentIndicator
Group ::= [SimpleGroup]::Prod
Group ::= [ProdsGroup]::"{" Prods "}"
Prods ::=
Prod
Range ::= [Range]::"-" CharacterCharacter
Range ::= Character
Renaming ::= [production]::"=>" ProdProd
Renaming ::= [Sym]::"=>" SymSym
Class ::= [SimpleCharClass]::"[" Range "]"
Class ::= [Bracket]::"(" Class ")"
Class ::= [Comp]::"~" Class
Class ::= [Diff]::"/" ClassClass
Class ::= [ISect]::"/\" ClassClass
Class ::= [Union]::"\/" ClassClass
ImpSection ::= [Imports]::"imports" Imports
Sym ::= [Empty]::"(" ")"
Sym ::= [Lit]::StrCon
Sym ::= [Opt]::"?"Sym
Sym ::= [Seq]::"(" Sym Sym ")"
Sym ::= [Bracket]::"(" Sym ")"
Sym ::= [CILit]::SingleQuotedStrCon
Sym ::= [Varsym]::"<" Sym "-VAR" ">"
Sym ::= [Sort]::Sort
Sym ::= [Lex]::"<" Sym "-LEX" ">"
Sym ::=
[Layout]::"LAYOUT"
Sym ::= [CF]::"<" Sym "-CF" ">"
Sym ::= [ParameterizedSort]::"[[" Sym "," "]]"Sort
Sym ::= [IterStar]::"*"Sym
Sym ::= [IterStarSep]::"{" Sym Sym "}" "*"
Sym ::= [Iter]::"+"Sym
Sym ::= [Class]::Class
Sym ::= [IterSep]::"{" Sym Sym "}" "+"
Sym ::= [Alt]::"|" SymSym
Sym ::= [Label]::":" SymLabel
RealCon ::= [RealCon]::"." NatCon OptExpIntCon
Lookahead ::= [Class]::[class]::Class
Lookahead ::= [Seq]::"." [las]::Lookaheads[class]::Class
Priorities ::= ","Priority
FunctionName ::= [QuotedFun]::StrCon
FunctionName ::= [UnquotedFun]::IdCon
Restriction ::= [Follow]::"-/-" LookaheadsSyms
Syms ::=
Sym
Prod ::= [Prod]::"->" Sym AttrsSyms
ModuleName ::= [Parameterized]::"[" [actuals]::Syms "]"[id]::ModuleId
ModuleName ::= [Unparameterized]::ε
Assoc ::=
[NonAssoc]::"non-assoc"
Assoc ::=
[Assoc]::"assoc"
Assoc ::=
[Left]::"left"
Assoc ::=
[Right]::"right"
ArgumentIndicator ::= [Default]::"<" NatCon "," ">"
IntCon ::= [Negative]::"-" NatCon
IntCon ::= [Natural]::NatCon
IntCon ::= [Positive]::"+" NatCon
Definition ::=
[modules]::Module
Alias ::= [Alias]::"->" SymSym
AFun ::= [Quoted]::StrCon
AFun ::= [Unquoted]::ε
Attribute ::= [Term]::ATermAttribute
Attribute ::= [Assoc]::Assoc
Attribute ::=
[Bracket]::"bracket"
Attribute ::= [Id]::"id" "(" ModuleName ")"
Attribute ::=
[Avoid]::"avoid"
Attribute ::=
[Prefer]::"prefer"
Attribute ::=
[Reject]::"reject"
Renamings ::= [Renamings]::"[" Renaming "]"