language-oberon-0.3: Parser, pretty-printer, and more for the Oberon programming language
Safe HaskellNone
LanguageHaskell2010

Language.Oberon.ConstantFolder

Description

The main export of this module is the function foldConstants that folds the constants in Oberon AST using a attribute grammar. Other exports are helper functions and attribute types that can be reused for other languages or attribute grammars.

This module expects the ambiguities in the AST to be already resolved by the Language.Oberon.Resolver module.

Synopsis

Documentation

foldConstants :: (Oberon l, Nameable l, Ord (QualIdent l), Show (QualIdent l), Atts (Inherited (Auto ConstantFold)) (Block l l Sem Sem) ~ InhCF l, Atts (Synthesized (Auto ConstantFold)) (Block l l Sem Sem) ~ SynCFMod' l (Block l l), Functor (Auto ConstantFold) (Block l l), Functor (Auto ConstantFold) (Block l l)) => Environment l -> Map Ident (Placed (Module l l Placed Placed)) -> Map Ident (Placed (Module l l Placed Placed)) Source #

Fold the constants in the given collection of Oberon modules (a Map of modules keyed by module name). It uses the constant declarations from the modules as well as the given Environment of predefined constants and functions. The value of the latter argument is typically predefined or predefined2.

newtype Modules l f' f Source #

Constructors

Modules 

Fields

Instances

Instances details
(Transformation t, Functor (Domain t), Functor t (Module l l), At t (Module l l (Codomain t) (Codomain t))) => Functor t (Modules l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

(<$>) :: t -> Modules l (Domain t) (Domain t) -> Modules l (Codomain t) (Codomain t) #

(Transformation t, At t (Module l l f f)) => Functor t (Modules l f) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

(<$>) :: t -> Modules l f (Domain t) -> Modules l f (Codomain t) #

Ord (QualIdent l) => Bequether (Auto ConstantFold) (Modules l) Sem Placed Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Ord (QualIdent l) => Synthesizer (Auto ConstantFold) (Modules l) Sem Placed Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

synthesis :: forall (sem :: Type -> Type). sem ~ Semantics (Auto ConstantFold) => Auto ConstantFold -> Placed (Modules l Sem Sem) -> Atts (Inherited (Auto ConstantFold)) (Modules l sem sem) -> Modules l sem (Synthesized (Auto ConstantFold)) -> Atts (Synthesized (Auto ConstantFold)) (Modules l sem sem) #

Functor (Modules l f' :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

(<$>) :: (forall (a :: k). p a -> q a) -> Modules l f' p -> Modules l f' q #

Apply (Modules l f' :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

(<*>) :: forall (p :: k -> Type) (q :: k -> Type). Modules l f' (p ~> q) -> Modules l f' p -> Modules l f' q #

liftA2 :: (forall (a :: k). p a -> q a -> r a) -> Modules l f' p -> Modules l f' q -> Modules l f' r #

liftA3 :: (forall (a :: k). p a -> q a -> r a -> s a) -> Modules l f' p -> Modules l f' q -> Modules l f' r -> Modules l f' s #

Ord (QualIdent l) => At (Auto ConstantFold) (Modules l Sem Sem) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Modules l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Modules l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

data ConstantFold Source #

Constructors

ConstantFold 

Instances

Instances details
(Ord (QualIdent l), v ~ Value l l Placed Placed) => SynthesizedField "designatorValue" (Maybe (Placed v)) (Auto ConstantFold) (Designator l l) Sem Placed Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

synthesizedField :: forall (sem :: Type -> Type). sem ~ Semantics (Auto ConstantFold) => Proxy "designatorValue" -> Auto ConstantFold -> Placed (Designator l l Sem Sem) -> Atts (Inherited (Auto ConstantFold)) (Designator l l sem sem) -> Designator l l sem (Synthesized (Auto ConstantFold)) -> Maybe (Placed v) #

(Nameable l, k ~ QualIdent l, v ~ Value l l Placed Placed, Ord k, Atts (Synthesized (Auto ConstantFold)) (ConstExpression l l Sem Sem) ~ SynCFExp l l) => SynthesizedField "moduleEnv" (Map k (Maybe v)) (Auto ConstantFold) (Declaration l l) Sem Placed Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

synthesizedField :: forall (sem :: Type -> Type). sem ~ Semantics (Auto ConstantFold) => Proxy "moduleEnv" -> Auto ConstantFold -> Placed (Declaration l l Sem Sem) -> Atts (Inherited (Auto ConstantFold)) (Declaration l l sem sem) -> Declaration l l sem (Synthesized (Auto ConstantFold)) -> Map k (Maybe v) #

(Nameable l, k ~ QualIdent l, v ~ Value l l Placed Placed, Ord k, Atts (Synthesized (Auto ConstantFold)) (Declaration l l Sem Sem) ~ SynCFMod' l (Declaration l l)) => SynthesizedField "moduleEnv" (Map k (Maybe v)) (Auto ConstantFold) (Block l l) Sem Placed Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

synthesizedField :: forall (sem :: Type -> Type). sem ~ Semantics (Auto ConstantFold) => Proxy "moduleEnv" -> Auto ConstantFold -> Placed (Block l l Sem Sem) -> Atts (Inherited (Auto ConstantFold)) (Block l l sem sem) -> Block l l sem (Synthesized (Auto ConstantFold)) -> Map k (Maybe v) #

Transformation (Auto ConstantFold) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Associated Types

type Domain (Auto ConstantFold) :: Type -> Type #

type Codomain (Auto ConstantFold) :: Type -> Type #

Ord (QualIdent l) => Bequether (Auto ConstantFold) (Modules l) Sem Placed Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Ord (QualIdent l) => Synthesizer (Auto ConstantFold) (Modules l) Sem Placed Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

synthesis :: forall (sem :: Type -> Type). sem ~ Semantics (Auto ConstantFold) => Auto ConstantFold -> Placed (Modules l Sem Sem) -> Atts (Inherited (Auto ConstantFold)) (Modules l sem sem) -> Modules l sem (Synthesized (Auto ConstantFold)) -> Atts (Synthesized (Auto ConstantFold)) (Modules l sem sem) #

(Functor (Auto ConstantFold) (ConditionalBranch l l), At (Auto ConstantFold) (ConditionalBranch l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (ConditionalBranch l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (CaseLabels l l), At (Auto ConstantFold) (CaseLabels l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (CaseLabels l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (Case l l), At (Auto ConstantFold) (Case l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (Case l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (WithAlternative l l), At (Auto ConstantFold) (WithAlternative l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (WithAlternative l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (Statement l l), At (Auto ConstantFold) (Statement l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (Statement l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (StatementSequence l l), At (Auto ConstantFold) (StatementSequence l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (StatementSequence l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (Block l l), At (Auto ConstantFold) (Block l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (Block l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (FPSection l l), At (Auto ConstantFold) (FPSection l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (FPSection l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (FormalParameters l l), At (Auto ConstantFold) (FormalParameters l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (FormalParameters l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (ProcedureHeading l l), At (Auto ConstantFold) (ProcedureHeading l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (ProcedureHeading l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (FieldList l l), At (Auto ConstantFold) (FieldList l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (FieldList l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (Type l l), At (Auto ConstantFold) (Type l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (Type l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (Designator l l), At (Auto ConstantFold) (Designator l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (Designator l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Functor (Auto ConstantFold) (Value l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (Element l l), At (Auto ConstantFold) (Element l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (Element l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (Expression l l), At (Auto ConstantFold) (Expression l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (Expression l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Functor (Auto ConstantFold) (Declaration l l), At (Auto ConstantFold) (Declaration l l (Codomain (Auto ConstantFold)) (Codomain (Auto ConstantFold)))) => Functor (Auto ConstantFold) (Declaration l l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

(Nameable l, Ord (QualIdent l), Atts (Synthesized (Auto ConstantFold)) (Declaration l l Sem Sem) ~ SynCFMod' l (Declaration l l), Atts (Inherited (Auto ConstantFold)) (StatementSequence l l Sem Sem) ~ InhCF l, Atts (Inherited (Auto ConstantFold)) (Declaration l l Sem Sem) ~ InhCF l) => Bequether (Auto ConstantFold) (Block l l) Sem Placed Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

bequest :: forall (sem :: Type -> Type). sem ~ Semantics (Auto ConstantFold) => Auto ConstantFold -> Placed (Block l l Sem Sem) -> Atts (Inherited (Auto ConstantFold)) (Block l l sem sem) -> Block l l sem (Synthesized (Auto ConstantFold)) -> Block l l sem (Inherited (Auto ConstantFold)) #

(Oberon l, Nameable l, Ord (QualIdent l), Value l ~ Value l, InhCF l ~ InhCF λ, Pretty (Value λ λ Identity Identity), Atts (Synthesized (Auto ConstantFold)) (Expression l l Sem Sem) ~ SynCFExp l l, Atts (Synthesized (Auto ConstantFold)) (Element l l Sem Sem) ~ SynCF' (Element l l), Atts (Synthesized (Auto ConstantFold)) (Designator l l Sem Sem) ~ SynCFDesignator l) => Synthesizer (Auto ConstantFold) (Expression λ l) Sem Placed Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

synthesis :: forall (sem :: Type -> Type). sem ~ Semantics (Auto ConstantFold) => Auto ConstantFold -> Placed (Expression λ l Sem Sem) -> Atts (Inherited (Auto ConstantFold)) (Expression λ l sem sem) -> Expression λ l sem (Synthesized (Auto ConstantFold)) -> Atts (Synthesized (Auto ConstantFold)) (Expression λ l sem sem) #

(Oberon l, Nameable l, Ord (QualIdent l), Show (QualIdent l), Atts (Synthesized (Auto ConstantFold)) (Block l l Sem Sem) ~ SynCFMod' l (Block l l)) => Synthesizer (Auto ConstantFold) (Module l l) Sem Placed Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Methods

synthesis :: forall (sem :: Type -> Type). sem ~ Semantics (Auto ConstantFold) => Auto ConstantFold -> Placed (Module l l Sem Sem) -> Atts (Inherited (Auto ConstantFold)) (Module l l sem sem) -> Module l l sem (Synthesized (Auto ConstantFold)) -> Atts (Synthesized (Auto ConstantFold)) (Module l l sem sem) #

Ord (QualIdent l) => At (Auto ConstantFold) (Modules l Sem Sem) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (ConditionalBranch l l) Sem Placed => At (Auto ConstantFold) (ConditionalBranch l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (CaseLabels l l) Sem Placed => At (Auto ConstantFold) (CaseLabels l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (Case l l) Sem Placed => At (Auto ConstantFold) (Case l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (WithAlternative l l) Sem Placed => At (Auto ConstantFold) (WithAlternative l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (Statement l l) Sem Placed => At (Auto ConstantFold) (Statement l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (StatementSequence l l) Sem Placed => At (Auto ConstantFold) (StatementSequence l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (Block l l) Sem Placed => At (Auto ConstantFold) (Block l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (FPSection l l) Sem Placed => At (Auto ConstantFold) (FPSection l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (FormalParameters l l) Sem Placed => At (Auto ConstantFold) (FormalParameters l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (ProcedureHeading l l) Sem Placed => At (Auto ConstantFold) (ProcedureHeading l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (FieldList l l) Sem Placed => At (Auto ConstantFold) (FieldList l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (Type l l) Sem Placed => At (Auto ConstantFold) (Type l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (Designator l l) Sem Placed => At (Auto ConstantFold) (Designator l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (Element l l) Sem Placed => At (Auto ConstantFold) (Element l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (Expression l l) Sem Placed => At (Auto ConstantFold) (Expression l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (Declaration l l) Sem Placed => At (Auto ConstantFold) (Declaration l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Attribution (Auto ConstantFold) (Module l l) Sem Placed => At (Auto ConstantFold) (Module l l (Semantics (Auto ConstantFold)) (Semantics (Auto ConstantFold))) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Codomain (Auto ConstantFold) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Domain (Auto ConstantFold) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Modules l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Modules l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (ConditionalBranch l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (CaseLabels l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (CaseLabels l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (Case l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Case l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (WithAlternative l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Statement l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Statement l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (StatementSequence l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Block l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Block l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (FPSection l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (FPSection l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (FormalParameters l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (ProcedureHeading l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (FieldList l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (FieldList l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (Type l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Type l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (Designator l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Designator l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (Value l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Value l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (Element l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Element l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (Expression l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Expression l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (Declaration l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Declaration l l _1 _2) = InhCF l
type Atts (Inherited (Auto ConstantFold)) (Module l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Inherited (Auto ConstantFold)) (Module l l _1 _2) = InhCF l
type Atts (Synthesized (Auto ConstantFold)) (ConditionalBranch l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (CaseLabels l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Case l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Case l l _1 _2) = SynCF' (Case l l)
type Atts (Synthesized (Auto ConstantFold)) (WithAlternative l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Statement l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (StatementSequence l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Block l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Block l l _1 _2) = SynCFMod' l (Block l l)
type Atts (Synthesized (Auto ConstantFold)) (FPSection l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (FormalParameters l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (ProcedureHeading l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (FieldList l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Type l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Type l l _1 _2) = SynCF' (Type l l)
type Atts (Synthesized (Auto ConstantFold)) (Designator l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Value l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Value l l _1 _2) = SynCF' (Value l l)
type Atts (Synthesized (Auto ConstantFold)) (Element l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Element l l _1 _2) = SynCF' (Element l l)
type Atts (Synthesized (Auto ConstantFold)) (Expression λ l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Expression λ l _1 _2) = SynCFExp λ l
type Atts (Synthesized (Auto ConstantFold)) (Declaration l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Module l l _1 _2) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Atts (Synthesized (Auto ConstantFold)) (Module l l _1 _2) = SynCFMod' l (Module l l)

data InhCFRoot l Source #

Constructors

InhCFRoot 

Fields

Instances

Instances details
Generic (InhCFRoot l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Associated Types

type Rep (InhCFRoot l) :: Type -> Type #

Methods

from :: InhCFRoot l -> Rep (InhCFRoot l) x #

to :: Rep (InhCFRoot l) x -> InhCFRoot l #

type Rep (InhCFRoot l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Rep (InhCFRoot l) = D1 ('MetaData "InhCFRoot" "Language.Oberon.ConstantFolder" "language-oberon-0.3-GkpXQW5Ts2RJCzciRMBWZC" 'False) (C1 ('MetaCons "InhCFRoot" 'PrefixI 'True) (S1 ('MetaSel ('Just "rootEnv") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Environment l))))

data InhCF l Source #

Constructors

InhCF 

Instances

Instances details
Generic (InhCF l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Associated Types

type Rep (InhCF l) :: Type -> Type #

Methods

from :: InhCF l -> Rep (InhCF l) x #

to :: Rep (InhCF l) x -> InhCF l #

type Rep (InhCF l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Rep (InhCF l) = D1 ('MetaData "InhCF" "Language.Oberon.ConstantFolder" "language-oberon-0.3-GkpXQW5Ts2RJCzciRMBWZC" 'False) (C1 ('MetaCons "InhCF" 'PrefixI 'True) (S1 ('MetaSel ('Just "env") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Environment l)) :*: S1 ('MetaSel ('Just "currentModule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident)))

data SynCF a Source #

Constructors

SynCF 

Fields

Instances

Instances details
Generic (SynCF a) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Associated Types

type Rep (SynCF a) :: Type -> Type #

Methods

from :: SynCF a -> Rep (SynCF a) x #

to :: Rep (SynCF a) x -> SynCF a #

type Rep (SynCF a) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Rep (SynCF a) = D1 ('MetaData "SynCF" "Language.Oberon.ConstantFolder" "language-oberon-0.3-GkpXQW5Ts2RJCzciRMBWZC" 'False) (C1 ('MetaCons "SynCF" 'PrefixI 'True) (S1 ('MetaSel ('Just "folded") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Mapped Placed a))))

data SynCFMod l a Source #

Constructors

SynCFMod 

Instances

Instances details
Generic (SynCFMod l a) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Associated Types

type Rep (SynCFMod l a) :: Type -> Type #

Methods

from :: SynCFMod l a -> Rep (SynCFMod l a) x #

to :: Rep (SynCFMod l a) x -> SynCFMod l a #

type Rep (SynCFMod l a) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Rep (SynCFMod l a) = D1 ('MetaData "SynCFMod" "Language.Oberon.ConstantFolder" "language-oberon-0.3-GkpXQW5Ts2RJCzciRMBWZC" 'False) (C1 ('MetaCons "SynCFMod" 'PrefixI 'True) (S1 ('MetaSel ('Just "moduleEnv") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Environment l)) :*: S1 ('MetaSel ('Just "folded") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Mapped Placed a))))

data SynCFDesignator l Source #

Instances

Instances details
Generic (SynCFDesignator l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

Associated Types

type Rep (SynCFDesignator l) :: Type -> Type #

type Rep (SynCFDesignator l) Source # 
Instance details

Defined in Language.Oberon.ConstantFolder

type Rep (SynCFDesignator l) = D1 ('MetaData "SynCFDesignator" "Language.Oberon.ConstantFolder" "language-oberon-0.3-GkpXQW5Ts2RJCzciRMBWZC" 'False) (C1 ('MetaCons "SynCFDesignator" 'PrefixI 'True) (S1 ('MetaSel ('Just "folded") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Mapped Placed (Designator l l Placed Placed))) :*: S1 ('MetaSel ('Just "designatorValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Placed (Value l l Placed Placed))))))

data SynCFRoot a Source #

Constructors

SynCFRoot 

Fields

Modules instances, TH candidates

Boring attribute types

type SynCF' node = SynCF (node Placed Placed) Source #

type SynCFMod' l node = SynCFMod l (node Placed Placed) Source #

Disambiguation

Rules

foldBinaryArithmetic :: forall λ l f. (f ~ Placed, Value l ~ Value l, Wirthy λ, Pretty (Value l l Identity Identity)) => (Int, ParsedLexemes, Int) -> (f (Expression l l f f) -> f (Expression l l f f) -> Expression λ l f f) -> (forall n. Num n => n -> n -> n) -> SynCFExp l l -> SynCFExp l l -> SynCFExp λ l Source #

foldBinaryFractional :: forall λ l f. (f ~ Placed, Value l ~ Value l, Wirthy λ, Pretty (Value l l Identity Identity)) => (Int, ParsedLexemes, Int) -> (f (Expression l l f f) -> f (Expression l l f f) -> Expression λ l f f) -> (forall n. Fractional n => n -> n -> n) -> SynCFExp l l -> SynCFExp l l -> SynCFExp λ l Source #

foldBinaryInteger :: forall λ l f. (f ~ Placed, Value l ~ Value l, Wirthy λ, Pretty (Value l l Identity Identity)) => (Int, ParsedLexemes, Int) -> (f (Expression l l f f) -> f (Expression l l f f) -> Expression λ l f f) -> (forall n. Integral n => n -> n -> n) -> SynCFExp l l -> SynCFExp l l -> SynCFExp λ l Source #

foldBinaryBoolean :: forall λ l f. (f ~ Placed, Value l ~ Value l, Wirthy λ, Pretty (Value l l Identity Identity)) => (Int, ParsedLexemes, Int) -> (f (Expression l l f f) -> f (Expression l l f f) -> Expression λ l f f) -> (Bool -> Bool -> Bool) -> SynCFExp l l -> SynCFExp l l -> SynCFExp λ l Source #

Unsafe Rank2 AST instances

predefined :: (Wirthy l, Ord (QualIdent l)) => Environment l Source #

The set of predefined types and procedures defined in the Oberon Language Report.

Orphan instances

Apply (Module l l f' :: (Type -> Type) -> Type) Source # 
Instance details

Methods

(<*>) :: forall (p :: k -> Type) (q :: k -> Type). Module l l f' (p ~> q) -> Module l l f' p -> Module l l f' q #

liftA2 :: (forall (a :: k). p a -> q a -> r a) -> Module l l f' p -> Module l l f' q -> Module l l f' r #

liftA3 :: (forall (a :: k). p a -> q a -> r a -> s a) -> Module l l f' p -> Module l l f' q -> Module l l f' r -> Module l l f' s #