Copyright | (c) 2017 Patrick Champion |
---|---|
License | see LICENSE file |
Maintainer | chlablak@gmail.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
AST for the EBNF language. Based on the grammar given in the ISO/IEC 14977:1996, page 10, part 8.2. Comments are valid in EBNF, but are not present in this AST.
- newtype Syntax = Syntax [SyntaxRule]
- data SyntaxRule
- newtype DefinitionsList = DefinitionsList [SingleDefinition]
- newtype SingleDefinition = SingleDefinition [Term]
- data Term = Term Factor (Maybe Exception)
- newtype Exception = Exception Factor
- data Factor = Factor (Maybe Integer) Primary
- data Primary
- newtype MetaIdentifier = MetaIdentifier String
AST
Start rule
Inner ASTs
data SyntaxRule Source #
Syntax rule
SyntaxRule MetaIdentifier DefinitionsList | Defines the sequence of symbols represented by a MetaIdentifier |
LexicalInner LexicalRule | Defines a lexical definition inside the EBNF grammar |
newtype DefinitionsList Source #
Separates alternative SingleDefinition
newtype SingleDefinition Source #
Separates successive Term
Represents any sequence of symbols that is defined by the Factor but not defined by the Exception
A Factor may be used as an Exception if it could be replaced by a Factor containing no MetaIdentifier
The Integer specifies the number of repetitions of the Primay
Primary
OptionalSequence DefinitionsList | Encloses symbols which are optional |
RepeatedSequence DefinitionsList | Encloses symbols which may be repeated any number of times |
GroupedSequence DefinitionsList | Allows any DefinitionsList to be a Primary |
PrimaryMetaIdentifier MetaIdentifier | A Primary can be a MetaIdentifier |
TerminalString String | Represents the characters between the quote symbols |
Empty | Empty Primary |
newtype MetaIdentifier Source #
A MetaIdentifier is the name of a syntactic element of the langage being defined