platinum-parsing-0.1.0.0: General Framework for compiler development.

Copyright(c) 2017 Patrick Champion
Licensesee LICENSE file
Maintainerchlablak@gmail.com
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

PP.Grammars.Ebnf

Contents

Description

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.

Synopsis

AST

Inner ASTs

data SyntaxRule Source #

Syntax rule

Constructors

SyntaxRule MetaIdentifier DefinitionsList

Defines the sequence of symbols represented by a MetaIdentifier

LexicalInner LexicalRule

Defines a lexical definition inside the EBNF grammar

data Term Source #

Represents any sequence of symbols that is defined by the Factor but not defined by the Exception

Constructors

Term Factor (Maybe Exception) 

newtype Exception Source #

A Factor may be used as an Exception if it could be replaced by a Factor containing no MetaIdentifier

Constructors

Exception Factor 

data Factor Source #

The Integer specifies the number of repetitions of the Primay

Constructors

Factor (Maybe Integer) Primary 

data Primary Source #

Primary

Constructors

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 ... or "..."

Empty

Empty Primary