language-oberon-0.3.4.1: Parser, pretty-printer, and more for the Oberon programming language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Oberon.Abstract

Description

Finally Tagless Abstract Syntax Tree definitions for the programming language Oberon

Synopsis

Language classes

class Wirthy l where Source #

The finally-tagless associated types and methods relevant to all programming languages designed by Niklaus Wirth. Every non-leaf node type has four type variables:

  • type variable l represents the language of the constructs built by the methods,
  • l' is the language of the child node constructs,
  • f' wraps all descendant nodes, except
  • f wraps all direct children of the node.

Associated Types

type Module l = (m :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | m -> l Source #

type Declaration l = (d :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | d -> l Source #

type Type l = (t :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | t -> l Source #

type Statement l = (s :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | s -> l Source #

type Expression l = (e :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | e -> l Source #

type Designator l = (d :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | d -> l Source #

type Value l = (v :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | v -> l Source #

type FieldList l = (x :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | x -> l Source #

type ProcedureHeading l = (x :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | x -> l Source #

type FormalParameters l = (x :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | x -> l Source #

type FPSection l = (x :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | x -> l Source #

type Block l = (x :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | x -> l Source #

type StatementSequence l = (x :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | x -> l Source #

type Case l = (x :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | x -> l Source #

type CaseLabels l = (x :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | x -> l Source #

type ConditionalBranch l = (x :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | x -> l Source #

type Element l = (x :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | x -> l Source #

type Import l = (x :: Type) | x -> l Source #

type IdentDef l = (x :: Type) | x -> l Source #

type QualIdent l = (x :: Type) | x -> l Source #

Methods

constantDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> f (ConstExpression l' l' f' f') -> Declaration l l' f' f Source #

typeDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> f (Type l' l' f' f') -> Declaration l l' f' f Source #

variableDeclaration :: forall l' f (f' :: Type -> Type). IdentList l' -> f (Type l' l' f' f') -> Declaration l l' f' f Source #

procedureDeclaration :: forall f l' (f' :: Type -> Type). f (ProcedureHeading l' l' f' f') -> f (Block l' l' f' f') -> Declaration l l' f' f Source #

formalParameters :: forall f l' (f' :: Type -> Type). [f (FPSection l' l' f' f')] -> Maybe (ReturnType l') -> FormalParameters l l' f' f Source #

fpSection :: forall f l' (f' :: Type -> Type). Bool -> [Ident] -> f (Type l' l' f' f') -> FPSection l l' f' f Source #

block :: forall f l' (f' :: Type -> Type). [f (Declaration l' l' f' f')] -> Maybe (f (StatementSequence l' l' f' f')) -> Block l l' f' f Source #

fieldList :: forall l' f (f' :: Type -> Type). NonEmpty (IdentDef l') -> f (Type l' l' f' f') -> FieldList l l' f' f Source #

pointerType :: forall f l' (f' :: Type -> Type). f (Type l' l' f' f') -> Type l l' f' f Source #

procedureType :: forall f l' (f' :: Type -> Type). Maybe (f (FormalParameters l' l' f' f')) -> Type l l' f' f Source #

typeReference :: forall l' (f' :: Type -> Type) (f :: Type -> Type). QualIdent l' -> Type l l' f' f Source #

assignment :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> f (Expression l' l' f' f') -> Statement l l' f' f Source #

caseStatement :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> [f (Case l' l' f' f')] -> Maybe (f (StatementSequence l' l' f' f')) -> Statement l l' f' f Source #

emptyStatement :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Statement l l' f' f Source #

exitStatement :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Statement l l' f' f Source #

ifStatement :: forall f l' (f' :: Type -> Type). NonEmpty (f (ConditionalBranch l' l' f' f')) -> Maybe (f (StatementSequence l' l' f' f')) -> Statement l l' f' f Source #

loopStatement :: forall f l' (f' :: Type -> Type). f (StatementSequence l' l' f' f') -> Statement l l' f' f Source #

procedureCall :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Maybe [f (Expression l' l' f' f')] -> Statement l l' f' f Source #

repeatStatement :: forall f l' (f' :: Type -> Type). f (StatementSequence l' l' f' f') -> f (Expression l' l' f' f') -> Statement l l' f' f Source #

returnStatement :: forall f l' (f' :: Type -> Type). Maybe (f (Expression l' l' f' f')) -> Statement l l' f' f Source #

whileStatement :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (StatementSequence l' l' f' f') -> Statement l l' f' f Source #

conditionalBranch :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (StatementSequence l' l' f' f') -> ConditionalBranch l l' f' f Source #

caseAlternative :: forall f l' (f' :: Type -> Type). NonEmpty (f (CaseLabels l' l' f' f')) -> f (StatementSequence l' l' f' f') -> Case l l' f' f Source #

singleLabel :: forall f l' (f' :: Type -> Type). f (ConstExpression l' l' f' f') -> CaseLabels l l' f' f Source #

labelRange :: forall f l' (f' :: Type -> Type). f (ConstExpression l' l' f' f') -> f (ConstExpression l' l' f' f') -> CaseLabels l l' f' f Source #

statementSequence :: forall f l' (f' :: Type -> Type). [f (Statement l' l' f' f')] -> StatementSequence l l' f' f Source #

add :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression l l' f' f Source #

subtract :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression l l' f' f Source #

and :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression l l' f' f Source #

or :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression l l' f' f Source #

divide :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression l l' f' f Source #

integerDivide :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression l l' f' f Source #

modulo :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression l l' f' f Source #

multiply :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression l l' f' f Source #

functionCall :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> [f (Expression l' l' f' f')] -> Expression l l' f' f Source #

literal :: forall f l' (f' :: Type -> Type). f (Value l' l' f' f') -> Expression l l' f' f Source #

negative :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression l l' f' f Source #

positive :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression l l' f' f Source #

not :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression l l' f' f Source #

read :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Expression l l' f' f Source #

relation :: forall f l' (f' :: Type -> Type). RelOp -> f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression l l' f' f Source #

element :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Element l l' f' f Source #

range :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Element l l' f' f Source #

integer :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Integer -> Value l l' f' f Source #

nil :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value l l' f' f Source #

false :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value l l' f' f Source #

true :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value l l' f' f Source #

real :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Double -> Value l l' f' f Source #

string :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Text -> Value l l' f' f Source #

charCode :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Int -> Value l l' f' f Source #

builtin :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Text -> Value l l' f' f Source #

variable :: forall l' (f' :: Type -> Type) (f :: Type -> Type). QualIdent l' -> Designator l l' f' f Source #

field :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Ident -> Designator l l' f' f Source #

index :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> NonEmpty (f (Expression l' l' f' f')) -> Designator l l' f' f Source #

dereference :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Designator l l' f' f Source #

identDef :: Ident -> IdentDef l Source #

nonQualIdent :: Ident -> QualIdent l Source #

Instances

Instances details
Wirthy Language Source # 
Instance details

Defined in Language.Oberon.AST

Associated Types

type Module Language 
Instance details

Defined in Language.Oberon.AST

type Declaration Language 
Instance details

Defined in Language.Oberon.AST

type Type Language 
Instance details

Defined in Language.Oberon.AST

type Statement Language 
Instance details

Defined in Language.Oberon.AST

type Expression Language 
Instance details

Defined in Language.Oberon.AST

type Designator Language 
Instance details

Defined in Language.Oberon.AST

type Value Language 
Instance details

Defined in Language.Oberon.AST

type FieldList Language 
Instance details

Defined in Language.Oberon.AST

type ProcedureHeading Language 
Instance details

Defined in Language.Oberon.AST

type FormalParameters Language 
Instance details

Defined in Language.Oberon.AST

type FPSection Language 
Instance details

Defined in Language.Oberon.AST

type Block Language 
Instance details

Defined in Language.Oberon.AST

type StatementSequence Language 
Instance details

Defined in Language.Oberon.AST

type Case Language 
Instance details

Defined in Language.Oberon.AST

type CaseLabels Language 
Instance details

Defined in Language.Oberon.AST

type ConditionalBranch Language 
Instance details

Defined in Language.Oberon.AST

type Element Language 
Instance details

Defined in Language.Oberon.AST

type Import Language 
Instance details

Defined in Language.Oberon.AST

type IdentDef Language 
Instance details

Defined in Language.Oberon.AST

type QualIdent Language 
Instance details

Defined in Language.Oberon.AST

Methods

constantDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> f (ConstExpression l' l' f' f') -> Declaration Language l' f' f Source #

typeDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> f (Type l' l' f' f') -> Declaration Language l' f' f Source #

variableDeclaration :: forall l' f (f' :: Type -> Type). IdentList l' -> f (Type l' l' f' f') -> Declaration Language l' f' f Source #

procedureDeclaration :: forall f l' (f' :: Type -> Type). f (ProcedureHeading l' l' f' f') -> f (Block l' l' f' f') -> Declaration Language l' f' f Source #

formalParameters :: forall f l' (f' :: Type -> Type). [f (FPSection l' l' f' f')] -> Maybe (ReturnType l') -> FormalParameters Language l' f' f Source #

fpSection :: forall f l' (f' :: Type -> Type). Bool -> [Ident] -> f (Type l' l' f' f') -> FPSection Language l' f' f Source #

block :: forall f l' (f' :: Type -> Type). [f (Declaration l' l' f' f')] -> Maybe (f (StatementSequence l' l' f' f')) -> Block Language l' f' f Source #

fieldList :: forall l' f (f' :: Type -> Type). NonEmpty (IdentDef l') -> f (Type l' l' f' f') -> FieldList Language l' f' f Source #

pointerType :: forall f l' (f' :: Type -> Type). f (Type l' l' f' f') -> Type Language l' f' f Source #

procedureType :: forall f l' (f' :: Type -> Type). Maybe (f (FormalParameters l' l' f' f')) -> Type Language l' f' f Source #

typeReference :: forall l' (f' :: Type -> Type) (f :: Type -> Type). QualIdent l' -> Type Language l' f' f Source #

assignment :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> f (Expression l' l' f' f') -> Statement Language l' f' f Source #

caseStatement :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> [f (Case l' l' f' f')] -> Maybe (f (StatementSequence l' l' f' f')) -> Statement Language l' f' f Source #

emptyStatement :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Statement Language l' f' f Source #

exitStatement :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Statement Language l' f' f Source #

ifStatement :: forall f l' (f' :: Type -> Type). NonEmpty (f (ConditionalBranch l' l' f' f')) -> Maybe (f (StatementSequence l' l' f' f')) -> Statement Language l' f' f Source #

loopStatement :: forall f l' (f' :: Type -> Type). f (StatementSequence l' l' f' f') -> Statement Language l' f' f Source #

procedureCall :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Maybe [f (Expression l' l' f' f')] -> Statement Language l' f' f Source #

repeatStatement :: forall f l' (f' :: Type -> Type). f (StatementSequence l' l' f' f') -> f (Expression l' l' f' f') -> Statement Language l' f' f Source #

returnStatement :: forall f l' (f' :: Type -> Type). Maybe (f (Expression l' l' f' f')) -> Statement Language l' f' f Source #

whileStatement :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (StatementSequence l' l' f' f') -> Statement Language l' f' f Source #

conditionalBranch :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (StatementSequence l' l' f' f') -> ConditionalBranch Language l' f' f Source #

caseAlternative :: forall f l' (f' :: Type -> Type). NonEmpty (f (CaseLabels l' l' f' f')) -> f (StatementSequence l' l' f' f') -> Case Language l' f' f Source #

singleLabel :: forall f l' (f' :: Type -> Type). f (ConstExpression l' l' f' f') -> CaseLabels Language l' f' f Source #

labelRange :: forall f l' (f' :: Type -> Type). f (ConstExpression l' l' f' f') -> f (ConstExpression l' l' f' f') -> CaseLabels Language l' f' f Source #

statementSequence :: forall f l' (f' :: Type -> Type). [f (Statement l' l' f' f')] -> StatementSequence Language l' f' f Source #

add :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression Language l' f' f Source #

subtract :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression Language l' f' f Source #

and :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression Language l' f' f Source #

or :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression Language l' f' f Source #

divide :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression Language l' f' f Source #

integerDivide :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression Language l' f' f Source #

modulo :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression Language l' f' f Source #

multiply :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression Language l' f' f Source #

functionCall :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> [f (Expression l' l' f' f')] -> Expression Language l' f' f Source #

literal :: forall f l' (f' :: Type -> Type). f (Value l' l' f' f') -> Expression Language l' f' f Source #

negative :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression Language l' f' f Source #

positive :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression Language l' f' f Source #

not :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression Language l' f' f Source #

read :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Expression Language l' f' f Source #

relation :: forall f l' (f' :: Type -> Type). RelOp -> f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression Language l' f' f Source #

element :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Element Language l' f' f Source #

range :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Element Language l' f' f Source #

integer :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Integer -> Value Language l' f' f Source #

nil :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value Language l' f' f Source #

false :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value Language l' f' f Source #

true :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value Language l' f' f Source #

real :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Double -> Value Language l' f' f Source #

string :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Text -> Value Language l' f' f Source #

charCode :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Int -> Value Language l' f' f Source #

builtin :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Text -> Value Language l' f' f Source #

variable :: forall l' (f' :: Type -> Type) (f :: Type -> Type). QualIdent l' -> Designator Language l' f' f Source #

field :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Ident -> Designator Language l' f' f Source #

index :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> NonEmpty (f (Expression l' l' f' f')) -> Designator Language l' f' f Source #

dereference :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Designator Language l' f' f Source #

identDef :: Ident -> IdentDef Language Source #

nonQualIdent :: Ident -> QualIdent Language Source #

Wirthy l => Wirthy (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

Associated Types

type Module (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Declaration (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Type (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Statement (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Expression (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Designator (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Value (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type FieldList (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type ProcedureHeading (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type FormalParameters (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type FPSection (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Block (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type StatementSequence (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Case (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type CaseLabels (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type ConditionalBranch (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Element (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Import (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type IdentDef (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type QualIdent (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

Methods

constantDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> f (ConstExpression l' l' f' f') -> Declaration (WirthySubsetOf l) l' f' f Source #

typeDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> f (Type l' l' f' f') -> Declaration (WirthySubsetOf l) l' f' f Source #

variableDeclaration :: forall l' f (f' :: Type -> Type). IdentList l' -> f (Type l' l' f' f') -> Declaration (WirthySubsetOf l) l' f' f Source #

procedureDeclaration :: forall f l' (f' :: Type -> Type). f (ProcedureHeading l' l' f' f') -> f (Block l' l' f' f') -> Declaration (WirthySubsetOf l) l' f' f Source #

formalParameters :: forall f l' (f' :: Type -> Type). [f (FPSection l' l' f' f')] -> Maybe (ReturnType l') -> FormalParameters (WirthySubsetOf l) l' f' f Source #

fpSection :: forall f l' (f' :: Type -> Type). Bool -> [Ident] -> f (Type l' l' f' f') -> FPSection (WirthySubsetOf l) l' f' f Source #

block :: forall f l' (f' :: Type -> Type). [f (Declaration l' l' f' f')] -> Maybe (f (StatementSequence l' l' f' f')) -> Block (WirthySubsetOf l) l' f' f Source #

fieldList :: forall l' f (f' :: Type -> Type). NonEmpty (IdentDef l') -> f (Type l' l' f' f') -> FieldList (WirthySubsetOf l) l' f' f Source #

pointerType :: forall f l' (f' :: Type -> Type). f (Type l' l' f' f') -> Type (WirthySubsetOf l) l' f' f Source #

procedureType :: forall f l' (f' :: Type -> Type). Maybe (f (FormalParameters l' l' f' f')) -> Type (WirthySubsetOf l) l' f' f Source #

typeReference :: forall l' (f' :: Type -> Type) (f :: Type -> Type). QualIdent l' -> Type (WirthySubsetOf l) l' f' f Source #

assignment :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> f (Expression l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

caseStatement :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> [f (Case l' l' f' f')] -> Maybe (f (StatementSequence l' l' f' f')) -> Statement (WirthySubsetOf l) l' f' f Source #

emptyStatement :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Statement (WirthySubsetOf l) l' f' f Source #

exitStatement :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Statement (WirthySubsetOf l) l' f' f Source #

ifStatement :: forall f l' (f' :: Type -> Type). NonEmpty (f (ConditionalBranch l' l' f' f')) -> Maybe (f (StatementSequence l' l' f' f')) -> Statement (WirthySubsetOf l) l' f' f Source #

loopStatement :: forall f l' (f' :: Type -> Type). f (StatementSequence l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

procedureCall :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Maybe [f (Expression l' l' f' f')] -> Statement (WirthySubsetOf l) l' f' f Source #

repeatStatement :: forall f l' (f' :: Type -> Type). f (StatementSequence l' l' f' f') -> f (Expression l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

returnStatement :: forall f l' (f' :: Type -> Type). Maybe (f (Expression l' l' f' f')) -> Statement (WirthySubsetOf l) l' f' f Source #

whileStatement :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (StatementSequence l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

conditionalBranch :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (StatementSequence l' l' f' f') -> ConditionalBranch (WirthySubsetOf l) l' f' f Source #

caseAlternative :: forall f l' (f' :: Type -> Type). NonEmpty (f (CaseLabels l' l' f' f')) -> f (StatementSequence l' l' f' f') -> Case (WirthySubsetOf l) l' f' f Source #

singleLabel :: forall f l' (f' :: Type -> Type). f (ConstExpression l' l' f' f') -> CaseLabels (WirthySubsetOf l) l' f' f Source #

labelRange :: forall f l' (f' :: Type -> Type). f (ConstExpression l' l' f' f') -> f (ConstExpression l' l' f' f') -> CaseLabels (WirthySubsetOf l) l' f' f Source #

statementSequence :: forall f l' (f' :: Type -> Type). [f (Statement l' l' f' f')] -> StatementSequence (WirthySubsetOf l) l' f' f Source #

add :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

subtract :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

and :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

or :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

divide :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

integerDivide :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

modulo :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

multiply :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

functionCall :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> [f (Expression l' l' f' f')] -> Expression (WirthySubsetOf l) l' f' f Source #

literal :: forall f l' (f' :: Type -> Type). f (Value l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

negative :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

positive :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

not :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

read :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

relation :: forall f l' (f' :: Type -> Type). RelOp -> f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

element :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Element (WirthySubsetOf l) l' f' f Source #

range :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Element (WirthySubsetOf l) l' f' f Source #

integer :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Integer -> Value (WirthySubsetOf l) l' f' f Source #

nil :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value (WirthySubsetOf l) l' f' f Source #

false :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value (WirthySubsetOf l) l' f' f Source #

true :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value (WirthySubsetOf l) l' f' f Source #

real :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Double -> Value (WirthySubsetOf l) l' f' f Source #

string :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Text -> Value (WirthySubsetOf l) l' f' f Source #

charCode :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Int -> Value (WirthySubsetOf l) l' f' f Source #

builtin :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Text -> Value (WirthySubsetOf l) l' f' f Source #

variable :: forall l' (f' :: Type -> Type) (f :: Type -> Type). QualIdent l' -> Designator (WirthySubsetOf l) l' f' f Source #

field :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Ident -> Designator (WirthySubsetOf l) l' f' f Source #

index :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> NonEmpty (f (Expression l' l' f' f')) -> Designator (WirthySubsetOf l) l' f' f Source #

dereference :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Designator (WirthySubsetOf l) l' f' f Source #

identDef :: Ident -> IdentDef (WirthySubsetOf l) Source #

nonQualIdent :: Ident -> QualIdent (WirthySubsetOf l) Source #

class Wirthy l => CoWirthy l where Source #

An instance of this type can convert its own constructs to another language that's an instance of TargetClass.

Associated Types

type TargetClass l :: Type -> Constraint Source #

Methods

coDeclaration :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass l l' => Declaration l l'' f' f -> Declaration l' l'' f' f Source #

coType :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass l l' => Type l l'' f' f -> Type l' l'' f' f Source #

coStatement :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass l l' => Statement l l'' f' f -> Statement l' l'' f' f Source #

coExpression :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass l l' => Expression l l'' f' f -> Expression l' l'' f' f Source #

coDesignator :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass l l' => Designator l l'' f' f -> Designator l' l'' f' f Source #

coValue :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass l l' => Value l l'' f' f -> Value l' l'' f' f Source #

Instances

Instances details
CoWirthy Language Source # 
Instance details

Defined in Language.Oberon.AST

Associated Types

type TargetClass Language 
Instance details

Defined in Language.Oberon.AST

Methods

coDeclaration :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass Language l' => Declaration Language l'' f' f -> Declaration l' l'' f' f Source #

coType :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass Language l' => Type Language l'' f' f -> Type l' l'' f' f Source #

coStatement :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass Language l' => Statement Language l'' f' f -> Statement l' l'' f' f Source #

coExpression :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass Language l' => Expression Language l'' f' f -> Expression l' l'' f' f Source #

coDesignator :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass Language l' => Designator Language l'' f' f -> Designator l' l'' f' f Source #

coValue :: forall l' l'' (f' :: Type -> Type) (f :: Type -> Type). TargetClass Language l' => Value Language l'' f' f -> Value l' l'' f' f Source #

class Wirthy l => Oberon l where Source #

The finally-tagless associated types and methods relevant to both versions of the Oberon language.

Associated Types

type WithAlternative l = (x :: Type -> (Type -> Type) -> (Type -> Type) -> Type) | x -> l Source #

Methods

moduleUnit :: forall f l' (f' :: Type -> Type). Ident -> [Import l] -> f (Block l' l' f' f') -> Module l l' f' f Source #

moduleImport :: Maybe Ident -> Ident -> Import l Source #

qualIdent :: Ident -> Ident -> QualIdent l Source #

getQualIdentNames :: QualIdent l -> Maybe (Ident, Ident) Source #

exported :: Ident -> IdentDef l Source #

forwardDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> Declaration l l' f' f Source #

procedureHeading :: forall l' f (f' :: Type -> Type). Bool -> IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> ProcedureHeading l l' f' f Source #

arrayType :: forall f l' (f' :: Type -> Type). [f (ConstExpression l' l' f' f')] -> f (Type l' l' f' f') -> Type l l' f' f Source #

recordType :: forall l' f (f' :: Type -> Type). Maybe (BaseType l') -> [f (FieldList l' l' f' f')] -> Type l l' f' f Source #

withStatement :: forall f l' (f' :: Type -> Type). f (WithAlternative l' l' f' f') -> Statement l l' f' f Source #

withAlternative :: forall l' f (f' :: Type -> Type). QualIdent l' -> QualIdent l' -> f (StatementSequence l' l' f' f') -> WithAlternative l l' f' f Source #

is :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> QualIdent l' -> Expression l l' f' f Source #

set :: forall f l' (f' :: Type -> Type). [f (Element l' l' f' f')] -> Expression l l' f' f Source #

typeGuard :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> QualIdent l' -> Designator l l' f' f Source #

Instances

Instances details
Oberon Language Source # 
Instance details

Defined in Language.Oberon.AST

Associated Types

type WithAlternative Language 
Instance details

Defined in Language.Oberon.AST

Methods

moduleUnit :: forall f l' (f' :: Type -> Type). Ident -> [Import Language] -> f (Block l' l' f' f') -> Module Language l' f' f Source #

moduleImport :: Maybe Ident -> Ident -> Import Language Source #

qualIdent :: Ident -> Ident -> QualIdent Language Source #

getQualIdentNames :: QualIdent Language -> Maybe (Ident, Ident) Source #

exported :: Ident -> IdentDef Language Source #

forwardDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> Declaration Language l' f' f Source #

procedureHeading :: forall l' f (f' :: Type -> Type). Bool -> IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> ProcedureHeading Language l' f' f Source #

arrayType :: forall f l' (f' :: Type -> Type). [f (ConstExpression l' l' f' f')] -> f (Type l' l' f' f') -> Type Language l' f' f Source #

recordType :: forall l' f (f' :: Type -> Type). Maybe (BaseType l') -> [f (FieldList l' l' f' f')] -> Type Language l' f' f Source #

withStatement :: forall f l' (f' :: Type -> Type). f (WithAlternative l' l' f' f') -> Statement Language l' f' f Source #

withAlternative :: forall l' f (f' :: Type -> Type). QualIdent l' -> QualIdent l' -> f (StatementSequence l' l' f' f') -> WithAlternative Language l' f' f Source #

is :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> QualIdent l' -> Expression Language l' f' f Source #

set :: forall f l' (f' :: Type -> Type). [f (Element l' l' f' f')] -> Expression Language l' f' f Source #

typeGuard :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> QualIdent l' -> Designator Language l' f' f Source #

Wirthy l => Oberon (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

Associated Types

type WithAlternative (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

Methods

moduleUnit :: forall f l' (f' :: Type -> Type). Ident -> [Import (WirthySubsetOf l)] -> f (Block l' l' f' f') -> Module (WirthySubsetOf l) l' f' f Source #

moduleImport :: Maybe Ident -> Ident -> Import (WirthySubsetOf l) Source #

qualIdent :: Ident -> Ident -> QualIdent (WirthySubsetOf l) Source #

getQualIdentNames :: QualIdent (WirthySubsetOf l) -> Maybe (Ident, Ident) Source #

exported :: Ident -> IdentDef (WirthySubsetOf l) Source #

forwardDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> Declaration (WirthySubsetOf l) l' f' f Source #

procedureHeading :: forall l' f (f' :: Type -> Type). Bool -> IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> ProcedureHeading (WirthySubsetOf l) l' f' f Source #

arrayType :: forall f l' (f' :: Type -> Type). [f (ConstExpression l' l' f' f')] -> f (Type l' l' f' f') -> Type (WirthySubsetOf l) l' f' f Source #

recordType :: forall l' f (f' :: Type -> Type). Maybe (BaseType l') -> [f (FieldList l' l' f' f')] -> Type (WirthySubsetOf l) l' f' f Source #

withStatement :: forall f l' (f' :: Type -> Type). f (WithAlternative l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

withAlternative :: forall l' f (f' :: Type -> Type). QualIdent l' -> QualIdent l' -> f (StatementSequence l' l' f' f') -> WithAlternative (WirthySubsetOf l) l' f' f Source #

is :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> QualIdent l' -> Expression (WirthySubsetOf l) l' f' f Source #

set :: forall f l' (f' :: Type -> Type). [f (Element l' l' f' f')] -> Expression (WirthySubsetOf l) l' f' f Source #

typeGuard :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> QualIdent l' -> Designator (WirthySubsetOf l) l' f' f Source #

class Oberon l => Oberon2 l where Source #

The finally-tagless associated types and methods relevant to the Oberon 2 language.

Methods

readOnly :: Ident -> IdentDef l Source #

typeBoundHeading :: forall l' f (f' :: Type -> Type). Bool -> Ident -> Ident -> Bool -> IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> ProcedureHeading l l' f' f Source #

forStatement :: forall f l' (f' :: Type -> Type). Ident -> f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Maybe (f (Expression l' l' f' f')) -> f (StatementSequence l' l' f' f') -> Statement l l' f' f Source #

variantWithStatement :: forall f l' (f' :: Type -> Type). NonEmpty (f (WithAlternative l' l' f' f')) -> Maybe (f (StatementSequence l' l' f' f')) -> Statement l l' f' f Source #

Instances

Instances details
Oberon2 Language Source # 
Instance details

Defined in Language.Oberon.AST

Methods

readOnly :: Ident -> IdentDef Language Source #

typeBoundHeading :: forall l' f (f' :: Type -> Type). Bool -> Ident -> Ident -> Bool -> IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> ProcedureHeading Language l' f' f Source #

forStatement :: forall f l' (f' :: Type -> Type). Ident -> f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Maybe (f (Expression l' l' f' f')) -> f (StatementSequence l' l' f' f') -> Statement Language l' f' f Source #

variantWithStatement :: forall f l' (f' :: Type -> Type). NonEmpty (f (WithAlternative l' l' f' f')) -> Maybe (f (StatementSequence l' l' f' f')) -> Statement Language l' f' f Source #

Wirthy l => Oberon2 (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

Methods

readOnly :: Ident -> IdentDef (WirthySubsetOf l) Source #

typeBoundHeading :: forall l' f (f' :: Type -> Type). Bool -> Ident -> Ident -> Bool -> IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> ProcedureHeading (WirthySubsetOf l) l' f' f Source #

forStatement :: forall f l' (f' :: Type -> Type). Ident -> f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Maybe (f (Expression l' l' f' f')) -> f (StatementSequence l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

variantWithStatement :: forall f l' (f' :: Type -> Type). NonEmpty (f (WithAlternative l' l' f' f')) -> Maybe (f (StatementSequence l' l' f' f')) -> Statement (WirthySubsetOf l) l' f' f Source #

class Wirthy l => Nameable l where Source #

Ability to deconstruct named constructs and obtain their Ident.

Instances

Instances details
Nameable Language Source # 
Instance details

Defined in Language.Oberon.AST

Type synonyms

Auxiliary data types

data RelOp Source #

Relational operators

Instances

Instances details
Data RelOp Source # 
Instance details

Defined in Language.Oberon.Abstract

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RelOp -> c RelOp #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RelOp #

toConstr :: RelOp -> Constr #

dataTypeOf :: RelOp -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RelOp) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RelOp) #

gmapT :: (forall b. Data b => b -> b) -> RelOp -> RelOp #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RelOp -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RelOp -> r #

gmapQ :: (forall d. Data d => d -> u) -> RelOp -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RelOp -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RelOp -> m RelOp #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RelOp -> m RelOp #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RelOp -> m RelOp #

Show RelOp Source # 
Instance details

Defined in Language.Oberon.Abstract

Methods

showsPrec :: Int -> RelOp -> ShowS #

show :: RelOp -> String #

showList :: [RelOp] -> ShowS #

Eq RelOp Source # 
Instance details

Defined in Language.Oberon.Abstract

Methods

(==) :: RelOp -> RelOp -> Bool #

(/=) :: RelOp -> RelOp -> Bool #

Pretty RelOp Source # 
Instance details

Defined in Language.Oberon.Pretty

Methods

pretty :: RelOp -> Doc ann #

prettyList :: [RelOp] -> Doc ann #

data WirthySubsetOf l Source #

A language with constructs beyond the base Wirthy class will have constructs that cannot be converted to a | Wirthy target. It can declare its TargetClass to be this transformed language instead, whose language | constructs are all wrapped in Maybe or Maybe3.

Constructors

WirthySubsetOf l 

Instances

Instances details
Wirthy l => Oberon (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

Associated Types

type WithAlternative (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

Methods

moduleUnit :: forall f l' (f' :: Type -> Type). Ident -> [Import (WirthySubsetOf l)] -> f (Block l' l' f' f') -> Module (WirthySubsetOf l) l' f' f Source #

moduleImport :: Maybe Ident -> Ident -> Import (WirthySubsetOf l) Source #

qualIdent :: Ident -> Ident -> QualIdent (WirthySubsetOf l) Source #

getQualIdentNames :: QualIdent (WirthySubsetOf l) -> Maybe (Ident, Ident) Source #

exported :: Ident -> IdentDef (WirthySubsetOf l) Source #

forwardDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> Declaration (WirthySubsetOf l) l' f' f Source #

procedureHeading :: forall l' f (f' :: Type -> Type). Bool -> IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> ProcedureHeading (WirthySubsetOf l) l' f' f Source #

arrayType :: forall f l' (f' :: Type -> Type). [f (ConstExpression l' l' f' f')] -> f (Type l' l' f' f') -> Type (WirthySubsetOf l) l' f' f Source #

recordType :: forall l' f (f' :: Type -> Type). Maybe (BaseType l') -> [f (FieldList l' l' f' f')] -> Type (WirthySubsetOf l) l' f' f Source #

withStatement :: forall f l' (f' :: Type -> Type). f (WithAlternative l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

withAlternative :: forall l' f (f' :: Type -> Type). QualIdent l' -> QualIdent l' -> f (StatementSequence l' l' f' f') -> WithAlternative (WirthySubsetOf l) l' f' f Source #

is :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> QualIdent l' -> Expression (WirthySubsetOf l) l' f' f Source #

set :: forall f l' (f' :: Type -> Type). [f (Element l' l' f' f')] -> Expression (WirthySubsetOf l) l' f' f Source #

typeGuard :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> QualIdent l' -> Designator (WirthySubsetOf l) l' f' f Source #

Wirthy l => Oberon2 (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

Methods

readOnly :: Ident -> IdentDef (WirthySubsetOf l) Source #

typeBoundHeading :: forall l' f (f' :: Type -> Type). Bool -> Ident -> Ident -> Bool -> IdentDef l' -> Maybe (f (FormalParameters l' l' f' f')) -> ProcedureHeading (WirthySubsetOf l) l' f' f Source #

forStatement :: forall f l' (f' :: Type -> Type). Ident -> f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Maybe (f (Expression l' l' f' f')) -> f (StatementSequence l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

variantWithStatement :: forall f l' (f' :: Type -> Type). NonEmpty (f (WithAlternative l' l' f' f')) -> Maybe (f (StatementSequence l' l' f' f')) -> Statement (WirthySubsetOf l) l' f' f Source #

Wirthy l => Wirthy (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

Associated Types

type Module (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Declaration (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Type (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Statement (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Expression (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Designator (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Value (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type FieldList (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type ProcedureHeading (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type FormalParameters (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type FPSection (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Block (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type StatementSequence (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Case (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type CaseLabels (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type ConditionalBranch (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Element (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type Import (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type IdentDef (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

type QualIdent (WirthySubsetOf l) 
Instance details

Defined in Language.Oberon.Abstract

Methods

constantDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> f (ConstExpression l' l' f' f') -> Declaration (WirthySubsetOf l) l' f' f Source #

typeDeclaration :: forall l' f (f' :: Type -> Type). IdentDef l' -> f (Type l' l' f' f') -> Declaration (WirthySubsetOf l) l' f' f Source #

variableDeclaration :: forall l' f (f' :: Type -> Type). IdentList l' -> f (Type l' l' f' f') -> Declaration (WirthySubsetOf l) l' f' f Source #

procedureDeclaration :: forall f l' (f' :: Type -> Type). f (ProcedureHeading l' l' f' f') -> f (Block l' l' f' f') -> Declaration (WirthySubsetOf l) l' f' f Source #

formalParameters :: forall f l' (f' :: Type -> Type). [f (FPSection l' l' f' f')] -> Maybe (ReturnType l') -> FormalParameters (WirthySubsetOf l) l' f' f Source #

fpSection :: forall f l' (f' :: Type -> Type). Bool -> [Ident] -> f (Type l' l' f' f') -> FPSection (WirthySubsetOf l) l' f' f Source #

block :: forall f l' (f' :: Type -> Type). [f (Declaration l' l' f' f')] -> Maybe (f (StatementSequence l' l' f' f')) -> Block (WirthySubsetOf l) l' f' f Source #

fieldList :: forall l' f (f' :: Type -> Type). NonEmpty (IdentDef l') -> f (Type l' l' f' f') -> FieldList (WirthySubsetOf l) l' f' f Source #

pointerType :: forall f l' (f' :: Type -> Type). f (Type l' l' f' f') -> Type (WirthySubsetOf l) l' f' f Source #

procedureType :: forall f l' (f' :: Type -> Type). Maybe (f (FormalParameters l' l' f' f')) -> Type (WirthySubsetOf l) l' f' f Source #

typeReference :: forall l' (f' :: Type -> Type) (f :: Type -> Type). QualIdent l' -> Type (WirthySubsetOf l) l' f' f Source #

assignment :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> f (Expression l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

caseStatement :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> [f (Case l' l' f' f')] -> Maybe (f (StatementSequence l' l' f' f')) -> Statement (WirthySubsetOf l) l' f' f Source #

emptyStatement :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Statement (WirthySubsetOf l) l' f' f Source #

exitStatement :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Statement (WirthySubsetOf l) l' f' f Source #

ifStatement :: forall f l' (f' :: Type -> Type). NonEmpty (f (ConditionalBranch l' l' f' f')) -> Maybe (f (StatementSequence l' l' f' f')) -> Statement (WirthySubsetOf l) l' f' f Source #

loopStatement :: forall f l' (f' :: Type -> Type). f (StatementSequence l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

procedureCall :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Maybe [f (Expression l' l' f' f')] -> Statement (WirthySubsetOf l) l' f' f Source #

repeatStatement :: forall f l' (f' :: Type -> Type). f (StatementSequence l' l' f' f') -> f (Expression l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

returnStatement :: forall f l' (f' :: Type -> Type). Maybe (f (Expression l' l' f' f')) -> Statement (WirthySubsetOf l) l' f' f Source #

whileStatement :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (StatementSequence l' l' f' f') -> Statement (WirthySubsetOf l) l' f' f Source #

conditionalBranch :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (StatementSequence l' l' f' f') -> ConditionalBranch (WirthySubsetOf l) l' f' f Source #

caseAlternative :: forall f l' (f' :: Type -> Type). NonEmpty (f (CaseLabels l' l' f' f')) -> f (StatementSequence l' l' f' f') -> Case (WirthySubsetOf l) l' f' f Source #

singleLabel :: forall f l' (f' :: Type -> Type). f (ConstExpression l' l' f' f') -> CaseLabels (WirthySubsetOf l) l' f' f Source #

labelRange :: forall f l' (f' :: Type -> Type). f (ConstExpression l' l' f' f') -> f (ConstExpression l' l' f' f') -> CaseLabels (WirthySubsetOf l) l' f' f Source #

statementSequence :: forall f l' (f' :: Type -> Type). [f (Statement l' l' f' f')] -> StatementSequence (WirthySubsetOf l) l' f' f Source #

add :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

subtract :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

and :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

or :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

divide :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

integerDivide :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

modulo :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

multiply :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

functionCall :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> [f (Expression l' l' f' f')] -> Expression (WirthySubsetOf l) l' f' f Source #

literal :: forall f l' (f' :: Type -> Type). f (Value l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

negative :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

positive :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

not :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

read :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

relation :: forall f l' (f' :: Type -> Type). RelOp -> f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Expression (WirthySubsetOf l) l' f' f Source #

element :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> Element (WirthySubsetOf l) l' f' f Source #

range :: forall f l' (f' :: Type -> Type). f (Expression l' l' f' f') -> f (Expression l' l' f' f') -> Element (WirthySubsetOf l) l' f' f Source #

integer :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Integer -> Value (WirthySubsetOf l) l' f' f Source #

nil :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value (WirthySubsetOf l) l' f' f Source #

false :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value (WirthySubsetOf l) l' f' f Source #

true :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Value (WirthySubsetOf l) l' f' f Source #

real :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Double -> Value (WirthySubsetOf l) l' f' f Source #

string :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Text -> Value (WirthySubsetOf l) l' f' f Source #

charCode :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Int -> Value (WirthySubsetOf l) l' f' f Source #

builtin :: forall l' (f' :: Type -> Type) (f :: Type -> Type). Text -> Value (WirthySubsetOf l) l' f' f Source #

variable :: forall l' (f' :: Type -> Type) (f :: Type -> Type). QualIdent l' -> Designator (WirthySubsetOf l) l' f' f Source #

field :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Ident -> Designator (WirthySubsetOf l) l' f' f Source #

index :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> NonEmpty (f (Expression l' l' f' f')) -> Designator (WirthySubsetOf l) l' f' f Source #

dereference :: forall f l' (f' :: Type -> Type). f (Designator l' l' f' f') -> Designator (WirthySubsetOf l) l' f' f Source #

identDef :: Ident -> IdentDef (WirthySubsetOf l) Source #

nonQualIdent :: Ident -> QualIdent (WirthySubsetOf l) Source #

type Block (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type Case (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type CaseLabels (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type ConditionalBranch (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type Declaration (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type Designator (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type Element (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type Expression (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type FPSection (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type FieldList (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type FormalParameters (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type IdentDef (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type Import (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type Module (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type ProcedureHeading (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type QualIdent (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type Statement (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type StatementSequence (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type Type (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type Value (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

type WithAlternative (WirthySubsetOf l) Source # 
Instance details

Defined in Language.Oberon.Abstract

newtype Maybe3 (f :: k -> k1 -> k2 -> Type) (a :: k) (b :: k1) (c :: k2) Source #

A modified Maybe with kind that fits the types associated with Wirthy.

Constructors

Maybe3 (Maybe (f a b c)) 

Instances

Instances details
Read (f a b c) => Read (Maybe3 f a b c) Source # 
Instance details

Defined in Language.Oberon.Abstract

Methods

readsPrec :: Int -> ReadS (Maybe3 f a b c) #

readList :: ReadS [Maybe3 f a b c] #

readPrec :: ReadPrec (Maybe3 f a b c) #

readListPrec :: ReadPrec [Maybe3 f a b c] #

Show (f a b c) => Show (Maybe3 f a b c) Source # 
Instance details

Defined in Language.Oberon.Abstract

Methods

showsPrec :: Int -> Maybe3 f a b c -> ShowS #

show :: Maybe3 f a b c -> String #

showList :: [Maybe3 f a b c] -> ShowS #

Eq (f a b c) => Eq (Maybe3 f a b c) Source # 
Instance details

Defined in Language.Oberon.Abstract

Methods

(==) :: Maybe3 f a b c -> Maybe3 f a b c -> Bool #

(/=) :: Maybe3 f a b c -> Maybe3 f a b c -> Bool #

Ord (f a b c) => Ord (Maybe3 f a b c) Source # 
Instance details

Defined in Language.Oberon.Abstract

Methods

compare :: Maybe3 f a b c -> Maybe3 f a b c -> Ordering #

(<) :: Maybe3 f a b c -> Maybe3 f a b c -> Bool #

(<=) :: Maybe3 f a b c -> Maybe3 f a b c -> Bool #

(>) :: Maybe3 f a b c -> Maybe3 f a b c -> Bool #

(>=) :: Maybe3 f a b c -> Maybe3 f a b c -> Bool #

max :: Maybe3 f a b c -> Maybe3 f a b c -> Maybe3 f a b c #

min :: Maybe3 f a b c -> Maybe3 f a b c -> Maybe3 f a b c #

Utilities

just3 :: forall {k1} {k2} {k3} {f} {a :: k1} {b :: k2} {c :: k3}. f a b c -> Maybe3 f a b c Source #

Smart Maybe3 constructor corresponding to Just

nothing3 :: forall {k1} {k2} {k3} {f :: k1 -> k2 -> k3 -> Type} {a :: k1} {b :: k2} {c :: k3}. Maybe3 f a b c Source #

Smart Maybe3 constructor corresponding to Nothing

maybe3 :: forall {k1} {k2} {k3} {b1} {f} {a :: k1} {b2 :: k2} {c :: k3}. b1 -> (f a b2 c -> b1) -> Maybe3 f a b2 c -> b1 Source #

Smart Maybe3 destructor corresponding to maybe