CoreErlang-0.0.1: Manipulating Core Erlang source code

Portabilityportable
Stabilityexperimental
MaintainerHenrique Ferreiro Garca <hferreiro@udc.es> David Castro Prez <dcastrop@udc.es>

Language.CoreErlang.Syntax

Contents

Description

A suite of datatypes describing the abstract syntax of CoreErlang 1.0.3. http://www.it.uu.se/research/group/hipe/cerl/

Synopsis

Modules

data Module Source

A CoreErlang source module.

Constructors

Module Atom [Function] [(Atom, Const)] [FunDef] 

Declarations

data FunDef Source

This type is used to represent lambdas

Constructors

FunDef (Ann Function) (Ann Exp) 

Expressions

data Exp Source

CoreErlang expression.

Constructors

Var Var

variable

Lit Literal

literal constant

Fun Function

function name

App Exps [Exps]

application

ModCall (Exps, Exps) [Exps]

module call

Lambda [Var] Exps

lambda expression

Seq Exps Exps

sequencing

Let ([Var], Exps) Exps

local declaration

LetRec [FunDef] Exps

letrec expression

Case Exps [Ann Alt]

case exp of alts end

Tuple [Exps]

tuple expression

List (List Exps)

list expression

Binary [BitString Exps]

binary expression

Op Atom [Exps]

operator application

Try Exps ([Var], Exps) ([Var], Exps)

try expression

Rec [Ann Alt] TimeOut

receive expression

Catch Exps

catch expression

Instances

data Exps Source

CoreErlang expressions.

Constructors

Exp (Ann Exp)

single expression

Exps (Ann [Ann Exp])

list of expressions

Instances

data Alt Source

An alt in a case expression

Constructors

Alt Pats Guard Exps 

Instances

data Guard Source

A guarded alternative when exp -> exp. The first expression will be Boolean-valued.

Constructors

Guard Exps 

data List a Source

A list of expressions

Constructors

L [a] 
LL [a] a 

Instances

Eq a => Eq (List a) 
Ord a => Ord (List a) 
Show a => Show (List a) 
Pretty a => Pretty (List a) 

data TimeOut Source

The timeout of a receive expression

Constructors

TimeOut Exps Exps 

data BitString a Source

A bitstring.

Constructors

BitString a [Exps] 

Instances

Eq a => Eq (BitString a) 
Ord a => Ord (BitString a) 
Show a => Show (BitString a) 
Pretty a => Pretty (BitString a) 

data Function Source

This type is used to represent function names

Constructors

Function (Atom, Integer) 

Patterns

data Pats Source

Constructors

Pat Pat

single pattern

Pats [Pat]

list of patterns

Instances

data Pat Source

A pattern, to be matched against a value.

Constructors

PVar Var

variable

PLit Literal

literal constant

PTuple [Pat]

tuple pattern

PList (List Pat)

list pattern

PBinary [BitString Pat]

list of bitstring patterns

PAlias Alias

alias pattern

Instances

data Alias Source

An alias, used in patterns

Constructors

Alias Var Pat 

Literals

data Literal Source

literal. Values of this type hold the abstract value of the literal, not the precise string representation used. For example, 10, 0o12 and 0xa have the same representation.

Constructors

LChar Char

character literal

LString String

string literal

LInt Integer

integer literal

LFloat Double

floating point literal

LAtom Atom

atom literal

LNil

empty list

data Const Source

This type is used to represent constants

Constructors

CLit Literal 
CTuple [Const] 
CList (List Const) 

data Atom Source

This type is used to represent atoms

Constructors

Atom String 

Instances

Variables

type Var = StringSource

This type is used to represent variables

Annotations

data Ann a Source

An annotation for modules, variables, ...

Constructors

Constr a

core erlang construct

Ann a [Const]

core erlang annotated construct

Instances

Eq a => Eq (Ann a) 
Ord a => Ord (Ann a) 
Show a => Show (Ann a) 
Pretty a => Pretty (Ann a)