Browsable SDF Grammar

CC-BY

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]

Summary

Syntax

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]::(AFun "(" {ATerm ","}+ ")")
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]::(Lookaheads "|" Lookaheads)
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]::(Character "-" Character)
Range ::=
	Character
Renaming ::=
	[production]::(Prod "=>" Prod)
Renaming ::=
	[Sym]::(Sym "=>" Sym)
Class ::=
	[SimpleCharClass]::("[" Range* "]")
Class ::=
	[Bracket]::("(" Class ")")
Class ::=
	[Comp]::("~" Class)
Class ::=
	[Diff]::(Class "/" Class)
Class ::=
	[ISect]::(Class "/\" Class)
Class ::=
	[Union]::(Class "\/" Class)
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]::(Sort "[[" {Sym ","}+ "]]")
Sym ::=
	[IterStar]::(Sym "*")
Sym ::=
	[IterStarSep]::("{" Sym Sym "}" "*")
Sym ::=
	[Iter]::(Sym "+")
Sym ::=
	[Class]::Class
Sym ::=
	[IterSep]::("{" Sym Sym "}" "+")
Sym ::=
	[Alt]::(Sym "|" Sym)
Sym ::=
	[Label]::(Label ":" Sym)
RealCon ::=
	[RealCon]::(IntCon "." NatCon OptExp)
Lookahead ::=
	[Class]::[class]::Class
Lookahead ::=
	[Seq]::([class]::Class "." [las]::Lookaheads)
Priorities ::=
	{Priority ","}*
FunctionName ::=
	[QuotedFun]::StrCon
FunctionName ::=
	[UnquotedFun]::IdCon
Restriction ::=
	[Follow]::(Syms "-/-" Lookaheads)
Syms ::=
	Sym*
Prod ::=
	[Prod]::(Syms "->" Sym Attrs)
ModuleName ::=
	[Parameterized]::([id]::ModuleId "[" [actuals]::Syms "]")
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]::(Sym "->" Sym)
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* "]")

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []