Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Modula-2 grammar adapted from ''Report on the Programming Language Modula-2''
Synopsis
- type NodeWrap = (,) (Down Int, ParsedLexemes, Down Int)
- data Modula2Grammar l f p = Modula2Grammar {
- ident :: p Ident
- number :: p (Value l l f f)
- integer :: p (Value l l f f)
- real :: p (Value l l f f)
- scaleFactor :: p Text
- hexDigit :: p Text
- digit :: p Text
- octalDigit :: p Text
- string_prod :: p Text
- qualident :: p (QualIdent l)
- constantDeclaration :: p (Declaration l l f f)
- constantDefinition :: p (Definition l l f f)
- constExpression :: p (NodeWrap (ConstExpression l l f f))
- relation :: p RelOp
- addOperator :: p (f (Expression l l f f) -> f (Expression l l f f) -> Expression l l f f)
- mulOperator :: p (f (Expression l l f f) -> f (Expression l l f f) -> Expression l l f f)
- set :: p (Expression l l f f)
- element :: p (Element l l f f)
- typeDeclaration :: p (Declaration l l f f)
- typeDefinition :: p (Definition l l f f)
- type_prod :: p (Type l l f f)
- simpleType :: p (Type l l f f)
- enumeration :: p (Type l l f f)
- identList :: p (IdentList l)
- subrangeType :: p (Type l l f f)
- arrayType :: p (Type l l f f)
- recordType :: p (Type l l f f)
- fieldListSequence :: p [f (FieldList l l f f)]
- fieldList :: p (FieldList l l f f)
- variant :: p (Variant l l f f)
- caseLabelList :: p (NonEmpty (f (CaseLabels l l f f)))
- caseLabels :: p (CaseLabels l l f f)
- setType :: p (Type l l f f)
- pointerType :: p (Type l l f f)
- procedureType :: p (Type l l f f)
- formalTypeList :: p (FormalParameters l l f f)
- variableDeclaration :: p (Declaration l l f f)
- variableDefinition :: p (Definition l l f f)
- designator :: p (Designator l l f f)
- expList :: p (NonEmpty (f (Expression l l f f)))
- expression :: p (NodeWrap (Expression l l f f))
- simpleExpression :: p (NodeWrap (Expression l l f f))
- term :: p (NodeWrap (Expression l l f f))
- factor :: p (NodeWrap (Expression l l f f))
- actualParameters :: p [f (Expression l l f f)]
- statement :: p (Statement l l f f)
- assignment :: p (Statement l l f f)
- procedureCall :: p (Statement l l f f)
- statementSequence :: p (NodeWrap (StatementSequence l l f f))
- ifStatement :: p (Statement l l f f)
- caseStatement :: p (Statement l l f f)
- case_prod :: p (Case l l f f)
- whileStatement :: p (Statement l l f f)
- repeatStatement :: p (Statement l l f f)
- forStatement :: p (Statement l l f f)
- loopStatement :: p (Statement l l f f)
- withStatement :: p (Statement l l f f)
- procedureDeclaration :: p (Declaration l l f f)
- procedureHeading :: p (Ident, ProcedureHeading l l f f)
- block :: p (Block l l f f)
- declarationSequence :: p [f (Declaration l l f f)]
- formalParameters :: p (FormalParameters l l f f)
- fPSection :: p (FPSection l l f f)
- formalType :: p (Type l l f f)
- moduleDeclaration :: p (Declaration l l f f)
- priority :: p (NodeWrap (Priority l l f f))
- export :: p (Export l)
- import_prod :: p (Import l)
- definitionModule :: p (Module l l f f)
- definitionSequence :: p [f (Definition l l f f)]
- programModule :: p (Module l l f f)
- compilationUnit :: p (NodeWrap (Module l l f f))
- type Parser = ParserT ((,) [[Lexeme]])
- modula2grammar :: Grammar (Modula2Grammar Language NodeWrap) Parser Text
- grammar :: forall l g. (Modula2 l, Apply g, LexicalParsing (Parser g Text)) => GrammarBuilder (Modula2Grammar l NodeWrap) g Parser Text
- comment :: Apply g => Parser g Text Text
- whiteSpace :: Apply g => LexicalParsing (Parser g Text) => Parser g Text ()
- wrap :: Apply g => Parser g Text a -> Parser g Text (NodeWrap a)
- moptional :: (Alternative f, Monoid (f a)) => f a -> f a
- delimiter :: LexicalParsing (Parser g Text) => Text -> Parser g Text ()
- operator :: LexicalParsing (Parser g Text) => Text -> Parser g Text ()
- reservedWords :: [Text]
- data Lexeme
- = WhiteSpace {
- lexemeText :: Text
- | Comment {
- lexemeText :: Text
- | Token { }
- = WhiteSpace {
- newtype ParsedLexemes = Trailing [Lexeme]
Documentation
data Modula2Grammar l f p Source #
The names and types of all the Modula-2 grammar productions
Instances
grammar :: forall l g. (Modula2 l, Apply g, LexicalParsing (Parser g Text)) => GrammarBuilder (Modula2Grammar l NodeWrap) g Parser Text Source #
All the productions of Modula-2 grammar
whiteSpace :: Apply g => LexicalParsing (Parser g Text) => Parser g Text () Source #
moptional :: (Alternative f, Monoid (f a)) => f a -> f a Source #
reservedWords :: [Text] Source #
WhiteSpace | |
| |
Comment | |
| |
Token | |
|
Instances
newtype ParsedLexemes #