language-Modula2-0.1: Parser, pretty-printer, and more for the Modula-2 programming language
Safe HaskellNone
LanguageHaskell2010

Language.Modula2

Description

The programming language Modula-2

Synopsis

Documentation

parseModule :: Version l -> Text -> ParseResults Text [Placed (Module l l Placed Placed)] Source #

Parse the given text of a single module.

parseAndSimplifyModule :: (Modula2 l, Nameable l, Functor (Auto ConstantFold) (Expression l l)) => Version l -> Text -> ParseResults Text [Placed (Module l l Placed Placed)] Source #

Parse the given text of a single module and fold constants inside it.

resolvePosition :: Text -> NodeWrap a -> Placed a Source #

Replace the stored positions of the given node with offset from the start of the given source text

resolvePositions :: (p ~ NodeWrap, q ~ Placed, Functor (Map p q) g) => Text -> p (g p p) -> q (g q q) Source #

Replace the stored positions in the entire tree with offsets from the start of the given source text

type Placed = (,) (Int, ParsedLexemes, Int) Source #

Every node in a parsed and resolved AST is wrapped with this functor

data Version l where Source #

Constructors

Report :: Version Language

the version specified by Niklaus Wirth's ''Report on the Programming Language Modula-2''

ISO :: Version Language

the version specified by the ISO standard

Instances

Instances details
Show (Version l) Source # 
Instance details

Defined in Language.Modula2

Methods

showsPrec :: Int -> Version l -> ShowS #

show :: Version l -> String #

showList :: [Version l] -> ShowS #

data SomeVersion where Source #

The language version in existential container

Constructors

SomeVersion :: Version l -> SomeVersion 

Instances

Instances details
Show SomeVersion Source # 
Instance details

Defined in Language.Modula2