[Haddock generated documentation igor@bytelabs.org**20070811140817] { adddir ./api addfile ./api/Ast-Attr.html addfile ./api/Ast-Bind.html addfile ./api/Ast-Code.html addfile ./api/Ast-Decl.html addfile ./api/Ast-Def.html addfile ./api/Ast-Ident.html addfile ./api/Ast-Incl.html addfile ./api/Ast-Node.html addfile ./api/Ast-Nt.html addfile ./api/Ast-Op.html addfile ./api/Ast-Prod.html addfile ./api/Ast-T.html addfile ./api/Ast-TermTy.html addfile ./api/Csa-Csa.html addfile ./api/Debug.html addfile ./api/Env-Elem.html addfile ./api/Env-Env.html addfile ./api/Gen-Emit-EmitClass.html addfile ./api/Gen-Emit-EmitEnums.html addfile ./api/Gen-Emit-EmitEval.html addfile ./api/Gen-Emit-EmitMapEntry.html addfile ./api/Gen-Emit-EmitNodeIf.html addfile ./api/Gen-Emit-EmitTiling.html addfile ./api/Gen-Emit-Java-JComment.html addfile ./api/Gen-Emit-Java-JConstructor.html addfile ./api/Gen-Emit-Java-JEnum.html addfile ./api/Gen-Emit-Java-JMethod.html addfile ./api/Gen-Emit-Java-JModifier.html addfile ./api/Gen-Emit-Java-JParameter.html addfile ./api/Gen-Emit-Java-JVariable.html addfile ./api/Gen-Emit-Java-Java.html addfile ./api/Gen-Emit-JavaClass.html addfile ./api/Gen-Emit-Label.html addfile ./api/Gen-Emit-Tiling.html addfile ./api/Gen-Emit.html addfile ./api/Main.html addfile ./api/Parser-Lexer.html addfile ./api/Parser-ParseErr.html addfile ./api/Parser-Parser.html addfile ./api/Util.html addfile ./api/doc-index-A.html addfile ./api/doc-index-B.html addfile ./api/doc-index-C.html addfile ./api/doc-index-D.html addfile ./api/doc-index-E.html addfile ./api/doc-index-G.html addfile ./api/doc-index-H.html addfile ./api/doc-index-I.html addfile ./api/doc-index-J.html addfile ./api/doc-index-L.html addfile ./api/doc-index-M.html addfile ./api/doc-index-N.html addfile ./api/doc-index-O.html addfile ./api/doc-index-P.html addfile ./api/doc-index-R.html addfile ./api/doc-index-S.html addfile ./api/doc-index-T.html addfile ./api/doc-index-U.html addfile ./api/doc-index.html addfile ./api/haddock.css addfile ./api/haddock.js addfile ./api/haskell_icon.gif addfile ./api/index.html addfile ./api/minus.gif addfile ./api/plus.gif hunk ./api/Ast-Attr.html 1 + + +Ast.Attr
 hburgContentsIndex
Ast.Attr
Contents
Introduction +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

This module includes the necessary abstractions in order to allow + for an attribute grammar formalism in our tree pattern language. + It represents an attribute with its operations: + * e.g.: nt : (in|out) Type ident : +

Synopsis
data Attr
data Ty
data AttrTy
= InAttr
| OutAttr
new :: Ident -> AttrTy -> Ty -> Attr
ty :: Ident -> Ty
emptyTy :: Ty
attrTy :: Attr -> Ty
attrId :: Attr -> Ident
attrIsOut :: Attr -> Bool
attrGetIn :: [Attr] -> [Attr]
attrGetOut :: [Attr] -> [Attr]
attrEqualInOut :: [Attr] -> [Attr] -> Bool
Introduction +
data Attr
Attribute datatype +
show/hide Instances
data Ty
Types in the host language (e.g. Jave, C#, etc.) +
show/hide Instances
Eq Ty
Show Ty
data AttrTy
Specifies whether the attribute is an input or an output attribute +
Constructors
InAttr
OutAttr
show/hide Instances
Eq AttrTy
Show AttrTy
Construction +
new :: Ident -> AttrTy -> Ty -> Attr
Create new attribute +
ty :: Ident -> Ty
Create attribute type +
emptyTy :: Ty
Create empty attribute type +
Functions +
attrTy :: Attr -> Ty
attrId :: Attr -> Ident
attrIsOut :: Attr -> Bool
attrGetIn :: [Attr] -> [Attr]
attrGetOut :: [Attr] -> [Attr]
attrEqualInOut :: [Attr] -> [Attr] -> Bool
Produced by Haddock version 0.8
hunk ./api/Ast-Bind.html 1 + + +Ast.Bind
 hburgContentsIndex
Ast.Bind
Contents
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Terminals and NonTerminals can be refered to in Semantic Actions by + supplying binding identifiers: + * Example: > nt = t t1 (: t1.toString(); :) + t1 is associated with the current incarnation of t and can + be used within a semantic action in order to refer to t. +

Synopsis
data Binding
new :: Ident -> Binding
empty :: Binding
hasBinding :: Binding -> Bool
getIdent :: Binding -> Ident
Types +
data Binding
Bindings for Terminals and NonTerminals +
show/hide Instances
Construction +
new :: Ident -> Binding
empty :: Binding
Functions +
hasBinding :: Binding -> Bool
getIdent :: Binding -> Ident
Produced by Haddock version 0.8
hunk ./api/Ast-Code.html 1 + + +Ast.Code
 hburgContentsIndex
Ast.Code
Contents
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

The target code within a semantic action is represented by this module: + * Example: '(: .... :)' + the stuff between '(:' and ':)' is target code. +

Synopsis
data Code
new :: String -> Code
empty :: Code
isEmpty :: Code -> Bool
Types +
data Code
Code data type +
show/hide Instances
Construction +
new :: String -> Code
empty :: Code
Functions +
isEmpty :: Code -> Bool
Produced by Haddock version 0.8
hunk ./api/Ast-Decl.html 1 + + +Ast.Decl
 hburgContentsIndex
Ast.Decl
Contents
Introduction +
Construction +
Description

Author : Igor Boehm igor@bytelabs.org +

Target code specified in the declaration section of the tree pattern + matching language. +

Synopsis
data Declaration
new :: Code -> Declaration
Introduction +
data Declaration
show/hide Instances
Construction +
new :: Code -> Declaration
Produced by Haddock version 0.8
hunk ./api/Ast-Def.html 1 + + +Ast.Def
 hburgContentsIndex
Ast.Def
Contents
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

This module provides the necessary abstractions to work with definitions. + Each non terminal must be defined and consists of one or more productions: + * Example: nt = prod1 + | prod2 + | ... + | prodN . +

Synopsis
data Definition
new :: Ident -> [Attr] -> Code -> [Prod] -> Definition
getCode :: Definition -> Code
getProds :: Definition -> [Prod]
getClosures :: Definition -> Closure
getNodeReturnType :: [Definition] -> Node -> Maybe Nt
getDefForProd :: [Definition] -> Prod -> Maybe Definition
setProds :: Definition -> [Prod] -> Definition
isNodeDefined :: [Definition] -> Node -> Bool
mergeDefs :: [Definition] -> Definition -> Either (Node, Node) [Definition]
Types +
data Definition
Non terminal definition type +
show/hide Instances
Construction +
new :: Ident -> [Attr] -> Code -> [Prod] -> Definition
Construct a non terminal +
Functions +
getCode :: Definition -> Code
getProds :: Definition -> [Prod]
getClosures :: Definition -> Closure
Array of Def nodes we have to hook up with +
getNodeReturnType :: [Definition] -> Node -> Maybe Nt
Given all definitions and a Node, the return 'type' if the Node + is calculated. +
getDefForProd :: [Definition] -> Prod -> Maybe Definition
Get definition for an NonTerm Prod. +
setProds :: Definition -> [Prod] -> Definition
isNodeDefined :: [Definition] -> Node -> Bool
Check if a production is defined +
mergeDefs :: [Definition] -> Definition -> Either (Node, Node) [Definition]
Merge definitions together +
Produced by Haddock version 0.8
hunk ./api/Ast-Ident.html 1 + + +Ast.Ident
 hburgContentsIndex
Ast.Ident
Contents
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

User defined identifiers of all kinds are represented by this module. + Examples of identifiers: + * bindings + * terminal and non terminal names +

Synopsis
data Ident
new :: String -> Ident
toIdent :: Token -> Ident
Types +
data Ident
A simple Identifier. +
show/hide Instances
Construction +
new :: String -> Ident
Functions +
toIdent :: Token -> Ident
Produced by Haddock version 0.8
hunk ./api/Ast-Incl.html 1 + + +Ast.Incl
 hburgContentsIndex
Ast.Incl
Contents
Types +
Construction +
Description

Author : Igor Boehm igor@bytelabs.org +

Target code specified in the include section of the tree pattern + matching language. +

Synopsis
data Include
new :: Code -> Include
Types +
data Include
show/hide Instances
Show Include
Construction +
new :: Code -> Include
Produced by Haddock version 0.8
hunk ./api/Ast-Node.html 1 + + +Ast.Node
 hburgContentsIndex
Ast.Node
Contents
Classes +
Types +
Construction +
Functions +
AST traversal functions +
Description

Author : Igor Boehm igor@bytelabs.org +

The input tree pattern matching grammar specification is converted into an + AST where this module, an AST node, is the primary substrate. +

Synopsis
class NodeClass a where
emptyNode :: a
isNil :: a -> Bool
addChild :: a -> a -> a
addSibling :: a -> a -> a
hasSibling :: a -> Bool
hasChildren :: a -> Bool
getChildren :: a -> [a]
getSiblings :: a -> [a]
data Node
new :: TermTy -> Code -> Code -> Node -> Code -> Node -> Code -> Node
addLinkBlockCode :: Node -> Code -> Code -> Node
setLink :: Node -> Node -> Node
getName :: Node -> String
getTy :: Node -> Maybe TermTy
getIdent :: Node -> Maybe Ident
getLink :: Node -> Node
getSem1 :: Node -> Code
getSem2 :: Node -> Code
getSem3 :: Node -> Code
getSem4 :: Node -> Code
getSem5 :: Node -> Code
getSem6 :: Node -> Code
equalIdents :: Node -> Node -> Bool
hasLink :: Node -> Bool
showAsFunction :: Node -> String
mapPreOrder :: (Node -> a) -> Node -> [a]
mapPreOrder2 :: (Int -> Node -> [a]) -> (Node -> b) -> Node -> [([a], b)]
mapPreOrder3 :: (Int -> Node -> [a]) -> ([a] -> Node -> [b]) -> ([a] -> Node -> [b]) -> Node -> [([a], [b], Node)]
mapChildren :: (Int -> Node -> a) -> Node -> [a]
Classes +
class NodeClass a where
AST Node class +
Methods
emptyNode :: a
isNil :: a -> Bool
addChild :: a -> a -> a
addSibling :: a -> a -> a
hasSibling :: a -> Bool
hasChildren :: a -> Bool
getChildren :: a -> [a]
getSiblings :: a -> [a]
show/hide Instances
Types +
data Node
AST Node type +
show/hide Instances
Construction +
new :: TermTy -> Code -> Code -> Node -> Code -> Node -> Code -> Node
Constructor for building a Node +
Functions +
addLinkBlockCode :: Node -> Code -> Code -> Node
Adds semantic action contained in link block +
setLink :: Node -> Node -> Node
getName :: Node -> String
getTy :: Node -> Maybe TermTy
getIdent :: Node -> Maybe Ident
getLink :: Node -> Node
getSem1 :: Node -> Code
getSem2 :: Node -> Code
getSem3 :: Node -> Code
getSem4 :: Node -> Code
getSem5 :: Node -> Code
getSem6 :: Node -> Code
equalIdents :: Node -> Node -> Bool
Compare Nodes based on identifiers +
hasLink :: Node -> Bool
showAsFunction :: Node -> String
Shows a node like a function 'name (child1, child2, etc.)' +
AST traversal functions +
mapPreOrder :: (Node -> a) -> Node -> [a]
mapPreOrder. +
mapPreOrder2 :: (Int -> Node -> [a]) -> (Node -> b) -> Node -> [([a], b)]
Note: The root is node is NOT processed! Processing starts from roots children. +
mapPreOrder3
:: (Int -> Node -> [a])path accumulation function +
-> ([a] -> Node -> [b])do this before recursing in pre order +
-> ([a] -> Node -> [b])do this after returning from pre order recursion +
-> Nodecurrent node +
-> [([a], [b], Node)]return type +
Note: The root node is NOT processed! Processing starts from roots children. +
mapChildren :: (Int -> Node -> a) -> Node -> [a]
mapChildren. +
Produced by Haddock version 0.8
hunk ./api/Ast-Nt.html 1 + + +Ast.Nt
 hburgContentsIndex
Ast.Nt
Contents
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Representation of a non terminal in our tree pattern matching grammar. +

Synopsis
data Nt
new :: Ident -> Binding -> [Attr] -> Nt
getIdent :: Nt -> Ident
getAttr :: Nt -> [Attr]
getBinding :: Nt -> Binding
hasBinding :: Nt -> Bool
Types +
data Nt
Non Terminal Type +
show/hide Instances
Construction +
new :: Ident -> Binding -> [Attr] -> Nt
Construct a non terminal +
Functions +
getIdent :: Nt -> Ident
getAttr :: Nt -> [Attr]
getBinding :: Nt -> Binding
hasBinding :: Nt -> Bool
Produced by Haddock version 0.8
hunk ./api/Ast-Op.html 1 + + +Ast.Op
 hburgContentsIndex
Ast.Op
Contents
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

This module represents an operator. Operators are defined in the operator + section of the tree pattern matching language. Operators need to be defined + for two reasons: + * CSA + * the ability to abstract away from the target language specific representation + of an operator and the name used in the tree pattern matching grammar + e.g.: ADD (: E_ADD :) would define the operator ADD which has a + target language specific definition, namely E_ADD. +

Synopsis
data Operator
op :: Ident -> Operator
opMap :: Ident -> Code -> Operator
opSem :: Operator -> Code
opHasSem :: Operator -> Bool
opId :: Operator -> Ident
Types +
data Operator
Operator Definition +
show/hide Instances
Construction +
op :: Ident -> Operator
Create Operator from Ident +
opMap :: Ident -> Code -> Operator
Create Operator from Ident and Code +
opSem :: Operator -> Code
retrieve semantic action possibly attached to operator +
Functions +
opHasSem :: Operator -> Bool
query if operator has a semantic action attached to it +
opId :: Operator -> Ident
retrieve operator token +
Produced by Haddock version 0.8
hunk ./api/Ast-Prod.html 1 + + +Ast.Prod
 hburgContentsIndex
Ast.Prod
Contents
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Each definition consists of one or more productions. This module provides + the necessary abstractions to deal with productions: + * e.g.: def = prod1 + | prod2 + | ... + | prodN +

Synopsis
type Cost = Int
data Prod
prod :: Node -> Cost -> Prod
getName :: Prod -> String
getProdsByIdent :: [Prod] -> Node -> [Prod]
getArity :: Prod -> Int
getNode :: Prod -> Node
getCost :: Prod -> Cost
getRuleLabel :: Prod -> RuleLabel
getResultLabel :: Prod -> ResultLabel
setRuleLabel :: Prod -> RuleLabel -> Prod
setResultLabel :: Prod -> ResultLabel -> Prod
toOp :: Prod -> Operator
isDefined :: [Prod] -> Node -> Bool
mergeProds :: [Prod] -> Prod -> Either (Node, Node) [Prod]
Types +
type Cost = Int
Cost for a production +
data Prod
Production type +
show/hide Instances
Construction +
prod :: Node -> Cost -> Prod
Constructor for building a production +
Functions +
getName :: Prod -> String
getProdsByIdent :: [Prod] -> Node -> [Prod]
Retrieves all productions which have the same identifier +
getArity :: Prod -> Int
getNode :: Prod -> Node
getCost :: Prod -> Cost
getRuleLabel :: Prod -> RuleLabel
getResultLabel :: Prod -> ResultLabel
setRuleLabel :: Prod -> RuleLabel -> Prod
setResultLabel :: Prod -> ResultLabel -> Prod
toOp :: Prod -> Operator
isDefined :: [Prod] -> Node -> Bool
mergeProds :: [Prod] -> Prod -> Either (Node, Node) [Prod]
Merges productions iff productions with the same name, have the same amount of parameters +
Produced by Haddock version 0.8
hunk ./api/Ast-T.html 1 + + +Ast.T
 hburgContentsIndex
Ast.T
Contents
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Representation of a terminal in our tree pattern matching grammar. +

Synopsis
data T
new :: Ident -> Binding -> T
getIdent :: T -> Ident
getBinding :: T -> Binding
hasBinding :: T -> Bool
Types +
data T
Terminal Definition +
show/hide Instances
Debug T
ElemClass T
Eq T
Ord T
Show T
Construction +
new :: Ident -> Binding -> T
Constructor for creating a T +
Functions +
getIdent :: T -> Ident
getBinding :: T -> Binding
hasBinding :: T -> Bool
Produced by Haddock version 0.8
hunk ./api/Ast-TermTy.html 1 + + +Ast.TermTy
 hburgContentsIndex
Ast.TermTy
Contents
Classes +
Types +
Construction +
Description

Author : Igor Boehm igor@bytelabs.org +

This module provides the necessary abstractions to deal with terminals + and non terminals in a uniform and generic way. Thus a TermTy can either + be a terminal of type T or a non terminal of type Nt. +

Synopsis
class TermTyClass a where
getId :: a -> Ident
isTerm :: a -> Bool
isNonTerm :: a -> Bool
getTerm :: a -> T
getNonTerm :: a -> Nt
hasAttr :: a -> Bool
getAttr :: a -> [Attr]
hasBinding :: a -> Bool
getBinding :: a -> Binding
equalBindings :: a -> a -> Bool
data TermTy
term :: T -> TermTy
nonTerm :: Nt -> TermTy
Classes +
class TermTyClass a where
All terminals and non terminals are instances of this class +
Methods
getId :: a -> Ident
isTerm :: a -> Bool
isNonTerm :: a -> Bool
getTerm :: a -> T
getNonTerm :: a -> Nt
hasAttr :: a -> Bool
getAttr :: a -> [Attr]
hasBinding :: a -> Bool
getBinding :: a -> Binding
equalBindings :: a -> a -> Bool
show/hide Instances
Types +
data TermTy
TermTy Type +
show/hide Instances
Construction +
term :: T -> TermTy
Construct TermTy out of T +
nonTerm :: Nt -> TermTy
Construct TermTy out o f Nt +
Produced by Haddock version 0.8
hunk ./api/Csa-Csa.html 1 + + +Csa.Csa
 hburgContentsIndex
Csa.Csa
Contents
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

This module contains various semantic analysis functions used + during the process of parsing the tree pattern matching language + specification. Tree pattern typechecking is also implemented in + this module. +

Synopsis
updateEnv :: TermTy -> Env -> Either (Elem, Elem) Env
checkEnv :: [Definition] -> Env -> Maybe [String]
checkDef :: Definition -> Maybe String
Functions +
updateEnv :: TermTy -> Env -> Either (Elem, Elem) Env
If Binding for TermTy is not in the Env return Right with + updated Env, otherwise return Left indicating the two culprits +
checkEnv :: [Definition] -> Env -> Maybe [String]
Checks if all nodes have been defined. Returns Nothing if checks succeed, + or a 'Just [String]' where '[String]' contains the the error messages. +
checkDef :: Definition -> Maybe String
Checks if a definition contains the following: + nt = nt1 + | nt2 + | nt <-- This is the error case since a definition is being defined in terms of itself + | nt3. +
Produced by Haddock version 0.8
hunk ./api/Debug.html 1 + + +Debug
 hburgContentsIndex
Debug
Contents
Classes +
Description

Author : Igor Boehm igor@bytelabs.org +

Data which can output debugging information about itself should implement + the Debug(..) class. +

Synopsis
class Show a => Debug a where
debug :: a -> String
Classes +
class Show a => Debug a where
Methods
debug :: a -> String
show/hide Instances
Produced by Haddock version 0.8
hunk ./api/Env-Elem.html 1 + + +Env.Elem
 hburgContentsIndex
Env.Elem
Contents
Classes +
Types +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Am Elem is defined as an existential type in order to hold heterogeneous + values which then get stuffed into an Environment (Env). +

Synopsis
class (Eq a, Ord a, Show a) => ElemClass a where
elemId :: a -> String
elemShow :: a -> String
elemType :: a -> ElemType
elemL :: a -> Int
elemC :: a -> Int
data ElemType
= EUnknown
| EDef
| EOp
| EIdent
| ETerm
| ENonTerm
data Elem
envElem :: ElemClass a => a -> Elem
Classes +
class (Eq a, Ord a, Show a) => ElemClass a where
Elements in an ElemClass must implement the following +
Methods
elemId :: a -> String
uniqueley identifies an Element +
elemShow :: a -> String
converts an element into a string +
elemType :: a -> ElemType
Env can hold heterogeneous elements. This function + should be used to convey which element it is. +
elemL :: a -> Int
every element in the environment must be declared at some + point and thus must reside on a line and column +
elemC :: a -> Int
show/hide Instances
data ElemType
Constructors
EUnknown
EDef
EOp
EIdent
ETerm
ENonTerm
show/hide Instances
Types +
data Elem
Use 'existential type' in order to be able to package heterogenous values + together with a bunch of functions that manipulate them, and then treat that + collection of packages in a uniform manner. In our case we want to stick different + things into Envs, and all these things implement ElemClass functions. + This is how it would work in the OO world and of course Haskell can do this as well ;-) + http://www.haskell.org/haskellwiki/Existential_types +
show/hide Instances
Functions +
envElem :: ElemClass a => a -> Elem
Constructor for creating Elems +
Produced by Haddock version 0.8
hunk ./api/Env-Env.html 1 + + +Env.Env
 hburgContentsIndex
Env.Env
Contents
Classes +
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Env is used heavily during CSA. It is stuffed with Elements and helps + to discover things like duplicate or missing definitions and bindings. +

Synopsis
class (Eq a, Ord a, Show a) => ElemClass a where
elemId :: a -> String
elemShow :: a -> String
elemType :: a -> ElemType
elemL :: a -> Int
elemC :: a -> Int
data ElemType
= EUnknown
| EDef
| EOp
| EIdent
| ETerm
| ENonTerm
data Env
data Elem
newEnv :: Elem -> Env
emptyEnv :: Env
addToEnv :: Env -> Elem -> Env
inEnv :: Env -> Elem -> Bool
getElem :: Env -> Elem -> Maybe Elem
envElem :: ElemClass a => a -> Elem
mergeEnvs :: Env -> Env -> Either (Elem, Elem) Env
Classes +
class (Eq a, Ord a, Show a) => ElemClass a where
Elements in an ElemClass must implement the following +
Methods
elemId :: a -> String
uniqueley identifies an Element +
elemShow :: a -> String
converts an element into a string +
elemType :: a -> ElemType
Env can hold heterogeneous elements. This function + should be used to convey which element it is. +
elemL :: a -> Int
every element in the environment must be declared at some + point and thus must reside on a line and column +
elemC :: a -> Int
show/hide Instances
data ElemType
Constructors
EUnknown
EDef
EOp
EIdent
ETerm
ENonTerm
show/hide Instances
Types +
data Env
An Env holds all operator mappings thus we can + type check if all the operators we used (a.k.a. Terminals) + have been defined and thus are valid. The Environment is + implemented by using Data.Map. +
show/hide Instances
Show Env
data Elem
Use 'existential type' in order to be able to package heterogenous values + together with a bunch of functions that manipulate them, and then treat that + collection of packages in a uniform manner. In our case we want to stick different + things into Envs, and all these things implement ElemClass functions. + This is how it would work in the OO world and of course Haskell can do this as well ;-) + http://www.haskell.org/haskellwiki/Existential_types +
show/hide Instances
Construction +
newEnv :: Elem -> Env
Constructor for creating an Env with one element +
emptyEnv :: Env
Constructor for creating an empty Env +
Functions +
addToEnv :: Env -> Elem -> Env
Adds Elem to an environment. If Elem already exists it will be overwritten. +
inEnv :: Env -> Elem -> Bool
Checks whether Elem already exists in Env +
getElem :: Env -> Elem -> Maybe Elem
Checks whether Elem already exists in Env and if it does it returns it. +
envElem :: ElemClass a => a -> Elem
Constructor for creating Elems +
mergeEnvs :: Env -> Env -> Either (Elem, Elem) Env
Merges two Envs. If there are clashes return Left Elem which indicates + which element was the culprit. Otherwise return Right Env. +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-EmitClass.html 1 + + +Gen.Emit.EmitClass
 hburgContentsIndex
Gen.Emit.EmitClass
Contents
Classes +
Description

Author : Igor Boehm igor@bytelabs.org +

Every class should know how to emit itself and where it belongs. +

Synopsis
class EmitClass a where
emit :: a -> String
emitTo :: a -> FilePath
Classes +
class EmitClass a where
Whatever is an instance of Emit must obviously be able to emit itself + and to tell where it wants to emit itself +
Methods
emit :: a -> String
emitTo :: a -> FilePath
show/hide Instances
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-EmitEnums.html 1 + + +Gen.Emit.EmitEnums
 hburgContentsIndex
Gen.Emit.EmitEnums
Contents
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

The resulting code uses enumerations for non terminals and rule labels. This + module is responsible for the creation of such Enumerations. It also modifies + the definition AST since the Rule labels used during the tiling and evaluation + phase are assigned here. +

Synopsis
genEnums :: Package -> [Definition] -> ([Definition], [Java])
Functions +
genEnums :: Package -> [Definition] -> ([Definition], [Java])
Generates all necessary enumerations. +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-EmitEval.html 1 + + +Gen.Emit.EmitEval
 hburgContentsIndex
Gen.Emit.EmitEval
Contents
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

TODO: Write short summary +

Synopsis
genEval :: Declaration -> [Definition] -> Java -> Java
Functions +
genEval :: Declaration -> [Definition] -> Java -> Java
This function is the top level function for generating the Target Source Code of the code emission. +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-EmitMapEntry.html 1 + + +Gen.Emit.EmitMapEntry
 hburgContentsIndex
Gen.Emit.EmitMapEntry
Contents
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Since Java does not support tuples, it is necessary to wrap up data (which one + would normally put into a Tuple) in a class. This is what this module emits, + a class which holds two values, the cost and the rule number. +

Each AST node in the target language has a map mapping non terminals + defined in the tree pattern matching language grammar to costs + and values, it looks something like: + * EnumMapNT, MapEntry> table = new EnumMap<NT, MapEntry(); +

Thus a MapEntry serves as a Tuple holding cost und rule number. +

Synopsis
genMapEntry :: Package -> Java
Functions +
genMapEntry :: Package -> Java
Generates MapEntry Java class +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-EmitNodeIf.html 1 + + +Gen.Emit.EmitNodeIf
 hburgContentsIndex
Gen.Emit.EmitNodeIf
Contents
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Depending on the tree pattern matching grammar specification, the + correct AST node Java interface is emitted by this module. +

Synopsis
genNodeInterface :: Package -> Children -> Link -> KindReturn -> Java
Functions +
genNodeInterface :: Package -> Children -> Link -> KindReturn -> Java
Generates Java Node Interface class. +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-EmitTiling.html 1 + + +Gen.Emit.EmitTiling
 hburgContentsIndex
Gen.Emit.EmitTiling
Contents
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

This module generates tiling target source code and the appropriate + Java node interface. +

Synopsis
genTiling :: [Operator] -> [Definition] -> NodeKind -> Java -> (Java, Java)
Functions +
genTiling :: [Operator] -> [Definition] -> NodeKind -> Java -> (Java, Java)
Top level function for generating tiling target source code and the appropriate node interface. +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-Java-JComment.html 1 + + +Gen.Emit.Java.JComment
 hburgContentsIndex
Gen.Emit.Java.JComment
Contents
Types +
Construction +
Description

Author : Igor Boehm igor@bytelabs.org +

Java comments. +

Synopsis
data JComment
new :: [String] -> JComment
Types +
data JComment
show/hide Instances
Construction +
new :: [String] -> JComment
Constructor for building a comment +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-Java-JConstructor.html 1 + + +Gen.Emit.Java.JConstructor
 hburgContentsIndex
Gen.Emit.Java.JConstructor
Contents
Types +
Construction +
Description

Author : Igor Boehm igor@bytelabs.org +

Java constructor. +

Synopsis
data JConstructor
new :: JModifier -> String -> [Parameter] -> Body -> JConstructor
Types +
data JConstructor
JConstructor type +
show/hide Instances
Construction +
new :: JModifier -> String -> [Parameter] -> Body -> JConstructor
Constructor for building a JConstructor +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-Java-JEnum.html 1 + + +Gen.Emit.Java.JEnum
 hburgContentsIndex
Gen.Emit.Java.JEnum
Contents
Types +
Construction +
Description

Author : Igor Boehm igor@bytelabs.org +

Java enumeration. +

Synopsis
data JEnum
new :: JModifier -> String -> [String] -> JEnum
Types +
data JEnum
show/hide Instances
Eq JEnum
Show JEnum
Construction +
new :: JModifier -> String -> [String] -> JEnum
Constructor for building a JModifier +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-Java-JMethod.html 1 + + +Gen.Emit.Java.JMethod
 hburgContentsIndex
Gen.Emit.Java.JMethod
Contents
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Java method. +

Synopsis
data JMethod
new :: JModifier -> Bool -> Type -> String -> [JParameter] -> Body -> JMethod
getName :: JMethod -> String
getRetTy :: JMethod -> Type
getParams :: JMethod -> [JParameter]
setComment :: JMethod -> JComment -> JMethod
setIfaceDef :: JMethod -> Bool -> JMethod
Types +
data JMethod
show/hide Instances
Construction +
new :: JModifier -> Bool -> Type -> String -> [JParameter] -> Body -> JMethod
Constructor for building a JMethod. +
Functions +
getName :: JMethod -> String
getRetTy :: JMethod -> Type
getParams :: JMethod -> [JParameter]
setComment :: JMethod -> JComment -> JMethod
setIfaceDef :: JMethod -> Bool -> JMethod
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-Java-JModifier.html 1 + + +Gen.Emit.Java.JModifier
 hburgContentsIndex
Gen.Emit.Java.JModifier
Contents
Types +
Description

Author : Igor Boehm igor@bytelabs.org +

Java modifiers. +

Synopsis
data JModifier
= Private
| Public
| Protected
| NoModifier
Types +
data JModifier
Java modifier types +
Constructors
Private
Public
Protected
NoModifier
show/hide Instances
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-Java-JParameter.html 1 + + +Gen.Emit.Java.JParameter
 hburgContentsIndex
Gen.Emit.Java.JParameter
Contents
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Java parameter type. +

Synopsis
data JParameter
new :: Type -> Ident -> JParameter
newFromList :: [(Type, Ident)] -> [JParameter]
getIdent :: JParameter -> Ident
getType :: JParameter -> Type
Types +
data JParameter
show/hide Instances
Construction +
new :: Type -> Ident -> JParameter
Constructor for building a new JParameter +
newFromList :: [(Type, Ident)] -> [JParameter]
Functions +
getIdent :: JParameter -> Ident
getType :: JParameter -> Type
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-Java-JVariable.html 1 + + +Gen.Emit.Java.JVariable
 hburgContentsIndex
Gen.Emit.Java.JVariable
Contents
Types +
Construction +
Description

Author : Igor Boehm igor@bytelabs.org +

Java variable type. +

Synopsis
data JVariable
new :: JModifier -> Bool -> Type -> String -> Constructor -> JVariable
Types +
data JVariable
show/hide Instances
Construction +
new :: JModifier -> Bool -> Type -> String -> Constructor -> JVariable
Constructor for building a new JVariable +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-Java-Java.html 1 + + +Gen.Emit.Java.Java
 hburgContentsIndex
Gen.Emit.Java.Java
Contents
Types +
Construction +
Description

Author : Igor Boehm igor@bytelabs.org +

This module implements the JavaClass type class and + represents a Java class (e.g. regular class, interface, enumration) +

Synopsis
data Java
java :: Package -> Name -> Java
Types +
data Java
Java Type +
show/hide Instances
Construction +
java :: Package -> Name -> Java
java. Smart constructor. +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-JavaClass.html 1 + + +Gen.Emit.JavaClass
 hburgContentsIndex
Gen.Emit.JavaClass
Contents
Classes +
Description

Author : Igor Boehm igor@bytelabs.org +

Type Class which captures most of the features a Java Class provides. +

More information on how to nest Java Classes in various ways + can be found at: + * http://en.wikibooks.org/wiki/Java_Programming/Nested_Classes + * http://java.sun.com/docs/books/tutorial/java/javaOO/nested.html +

Synopsis
class EmitClass a => JavaClass a where
jSetPackage :: a -> String -> a
jGetPackage :: a -> String
jSetImports :: a -> [String] -> a
jGetImports :: a -> [String]
jGetComments :: a -> JComment
jSetComments :: a -> JComment -> a
jSetClassName :: a -> String -> a
jGetClassName :: a -> String
jSetStaticInitializer :: a -> String -> a
jGetStaticInitializer :: a -> String
jSetConstructors :: a -> [JConstructor] -> a
jGetConstructors :: a -> [JConstructor]
jSetVariables :: a -> [JVariable] -> a
jGetVariables :: a -> [JVariable]
jSetMethods :: a -> [JMethod] -> a
jGetMethods :: a -> [JMethod]
jSetModifier :: a -> JModifier -> a
jGetModifier :: a -> JModifier
jIsStatic :: a -> Bool
jSetStatic :: a -> Bool -> a
jIsFinal :: a -> Bool
jSetFinal :: a -> Bool -> a
jIsIface :: a -> Bool
jSetIface :: a -> Bool -> a
jSetNestedClasses :: a -> [a] -> a
jGetNestedClasses :: a -> [a]
jSetEnumClasses :: a -> [JEnum] -> a
jGetEnumClasses :: a -> [JEnum]
jSetAdditionalClasses :: a -> [a] -> a
jGetAdditionalClasses :: a -> [a]
jSetUserCode :: a -> String -> a
jGetUserCode :: a -> String
Classes +
class EmitClass a => JavaClass a where
Methods
jSetPackage :: a -> String -> a
set package name in which this class resides +
jGetPackage :: a -> String
retrieve class package name +
jSetImports :: a -> [String] -> a
set imports for this class +
jGetImports :: a -> [String]
get imports for this class +
jGetComments :: a -> JComment
get class comments +
jSetComments :: a -> JComment -> a
get class comments +
jSetClassName :: a -> String -> a
set class name +
jGetClassName :: a -> String
get class name +
jSetStaticInitializer :: a -> String -> a
set static initializer block +
jGetStaticInitializer :: a -> String
get static initializer block +
jSetConstructors :: a -> [JConstructor] -> a
set constructors +
jGetConstructors :: a -> [JConstructor]
get constructors +
jSetVariables :: a -> [JVariable] -> a
set class variables +
jGetVariables :: a -> [JVariable]
get class variables +
jSetMethods :: a -> [JMethod] -> a
set methods +
jGetMethods :: a -> [JMethod]
get methods +
jSetModifier :: a -> JModifier -> a
set class modifier +
jGetModifier :: a -> JModifier
get class modifier +
jIsStatic :: a -> Bool
is the class a static class +
jSetStatic :: a -> Bool -> a
jIsFinal :: a -> Bool
is the class a final class +
jSetFinal :: a -> Bool -> a
jIsIface :: a -> Bool
is this an interface +
jSetIface :: a -> Bool -> a
jSetNestedClasses :: a -> [a] -> a
add nested classes to this class +
jGetNestedClasses :: a -> [a]
get nested classes from this class +
jSetEnumClasses :: a -> [JEnum] -> a
add enumeration classes to this class +
jGetEnumClasses :: a -> [JEnum]
get enumeration classes from this class +
jSetAdditionalClasses :: a -> [a] -> a
add additional class to this class: + * A Java file can have one and only one public Java class. + But the file can contain additional non public classes. +
jGetAdditionalClasses :: a -> [a]
get additional java classes +
jSetUserCode :: a -> String -> a
set user defined code which gets included right after the class declaration. + This code is defined in the declerations part of the tree pattern matching + grammar. +
jGetUserCode :: a -> String
get user defined code +
show/hide Instances
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-Label.html 1 + + +Gen.Emit.Label
 hburgContentsIndex
Gen.Emit.Label
Contents
Types +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Non terminals defined in our tree pattern matching language, as well as + rule labels generated during the tiling phase, and others use these + functions in order to guarantee consistent naming. +

Synopsis
type Label = String
tTyToEnumLabel :: TermTy -> Label
ntToEnumLabel :: Nt -> Label
defToEnumLabel :: Definition -> Label
defToEvalLabel :: Definition -> Label
tTyToEvalLabel :: TermTy -> Label
prodToEnumLabel :: Definition -> Prod -> Suffix -> Label
childCallLabel :: Int -> String
Types +
type Label = String
Functions +
tTyToEnumLabel :: TermTy -> Label
Generate label for TermTy +
ntToEnumLabel :: Nt -> Label
Generate label for Nt +
defToEnumLabel :: Definition -> Label
Generate label for Definition +
defToEvalLabel :: Definition -> Label
Generate label for evaluation methods given a definition +
tTyToEvalLabel :: TermTy -> Label
Generate label for evaluation methods given a TermTy +
prodToEnumLabel :: Definition -> Prod -> Suffix -> Label
Generate label for Production +
childCallLabel :: Int -> String
Generates node child access label: + * 'n.child0()' or 'n.child1()' for left and right child +
Produced by Haddock version 0.8
hunk ./api/Gen-Emit-Tiling.html 1 + + +Gen.Emit.Tiling
 hburgContentsIndex
Gen.Emit.Tiling
Contents
Types +
Construction +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Given operators and definitions extracted from the tree pattern matching + language specification, this module calculates all parameters which are + necessary in order to easily emit target code for the dynamic programming + stage of our code generator, namely the tiling phase. +

Synopsis
data Tiling
data Closure
type Arity = Int
type LinkSet = Set Operator
type OperatorsPerArity = Map Arity (Set Operator)
type ProductionsPerArity = Map Arity [Prod]
new :: [Operator] -> [Definition] -> Tiling
getClosures :: Tiling -> [Closure]
hasClosures :: Tiling -> Bool
getProductionsPerArity :: Tiling -> ProductionsPerArity
getOperatorsPerArity :: Tiling -> OperatorsPerArity
getLinkSet :: Tiling -> LinkSet
getProdsForArity :: Tiling -> Arity -> [Prod]
closureGetFromLabel :: Closure -> Label
closureGetRuleLabel :: Closure -> Label
closureGetToLabel :: Closure -> Label
Types +
data Tiling
Tiling. +
show/hide Instances
Show Tiling
data Closure
show/hide Instances
type Arity = Int
type LinkSet = Set Operator
LinkSet. Set of operators having links +
type OperatorsPerArity = Map Arity (Set Operator)
OperatorsPerArity. Map of operators keyed by their arity +
type ProductionsPerArity = Map Arity [Prod]
ProductionsPerArity. Map of productions keyed by their arity +
Construction +
new :: [Operator] -> [Definition] -> Tiling
Constructs a Tiling from Operators and Definitions. This function unwraps definitions and extracts + all the necessary information in order to produce the Dynamic Programming + part of our code generator, namely the tiling. It starts off with an + initially almost empty Tiling and as the definitions are processed + as much information as possible is gathered to avoid repeated traversals + of the definition list. +
Functions +
getClosures :: Tiling -> [Closure]
hasClosures :: Tiling -> Bool
getProductionsPerArity :: Tiling -> ProductionsPerArity
getOperatorsPerArity :: Tiling -> OperatorsPerArity
getLinkSet :: Tiling -> LinkSet
getProdsForArity :: Tiling -> Arity -> [Prod]
closureGetFromLabel :: Closure -> Label
closureGetRuleLabel :: Closure -> Label
closureGetToLabel :: Closure -> Label
Produced by Haddock version 0.8
hunk ./api/Gen-Emit.html 1 + + +Gen.Emit
 hburgContentsIndex
Gen.Emit
Description

Author : Igor Boehm igor@bytelabs.org +

This module creates all the necessary code given an AST of definitions + from the tree pattern matching language. The emit() function is the main + interface to the outside, abstracting away from the business of code generation. +

Synopsis
emit :: Class -> Package -> NodeKind -> Include -> Declaration -> [Operator] -> [Definition] -> [Java]
Documentation
emit :: Class -> Package -> NodeKind -> Include -> Declaration -> [Operator] -> [Definition] -> [Java]
Generates all the code which is necessary in order to make our code generator work. +
Produced by Haddock version 0.8
hunk ./api/Main.html 1 + + +Main
 hburgContentsIndex
Main
Description

Author : Igor Boehm igor@bytelabs.org +

The main entry point of our code generator. In here we do several things, + namely: + * handles CLI args + * feeds the lexer and reacts to possible errors + * feeds the parser and reacts to possible errors + * feeds the code generator and emits its result to a file +

Synopsis
main :: IO ()
usageHeader :: String -> String
byeStr :: String -> IO a
bye :: IO a
showTokens :: [Token] -> IO a
die :: String -> IO a
dieCodeGen :: String -> IO a
data CLIFlags
= OptHelp
| OptOutputClass String
| OptOutputPackage String
| OptNodeKindType String
| OptDebug
constArgs :: [a]
argInfo :: [OptDescr CLIFlags]
getOutputClassName :: [CLIFlags] -> IO String
getOutputPackage :: [CLIFlags] -> IO String
getNodeKindType :: [CLIFlags] -> IO String
codeGen :: [String] -> IO ()
runParse :: String -> Either (String, String) (Include, Declaration, [Operator], [Definition], String)
outputClass :: EmitClass a => [a] -> IO [()]
Documentation
main :: IO ()
main. Read arguments and start code generator +
usageHeader :: String -> String
byeStr :: String -> IO a
bye :: IO a
showTokens :: [Token] -> IO a
die :: String -> IO a
dieCodeGen :: String -> IO a
data CLIFlags
Constructors
OptHelp
OptOutputClass String
OptOutputPackage String
OptNodeKindType String
OptDebug
show/hide Instances
constArgs :: [a]
argInfo :: [OptDescr CLIFlags]
getOutputClassName :: [CLIFlags] -> IO String
getOutputPackage :: [CLIFlags] -> IO String
getNodeKindType :: [CLIFlags] -> IO String
codeGen :: [String] -> IO ()
Evaluate arguments and kick of scanner and parser +
runParse :: String -> Either (String, String) (Include, Declaration, [Operator], [Definition], String)
Runs the Lexer and Parser +
outputClass :: EmitClass a => [a] -> IO [()]
Output generated class into a file +
Produced by Haddock version 0.8
hunk ./api/Parser-Lexer.html 1 + + +Parser.Lexer
 hburgContentsIndex
Parser.Lexer
Contents
Classes +
Types +
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

Tree pattern matching language ALEX lexer specification. +

Synopsis
data TokenClass
= TCost
| TSemAction
| TKeyword
| TIdent
| TAttrStart
| TAttrEnd
| TAttrKeyword
| TAttrIdent
| TTerm
| TComma
| TOr
| TParenOpen
| TParenClose
| TBoxOpen
| TBoxClose
| TAssign
| TColon
| TPeriod
| TEOF
data Token = ConToken AlexPosn TokenClass String
scanner :: String -> Either String [Token]
Classes +
data TokenClass
Token Classes +
Constructors
TCost
TSemAction
TKeyword
TIdent
TAttrStart
TAttrEnd
TAttrKeyword
TAttrIdent
TTerm
TComma
TOr
TParenOpen
TParenClose
TBoxOpen
TBoxClose
TAssign
TColon
TPeriod
TEOF
show/hide Instances
Types +
data Token
Token Datatype +
Constructors
ConToken AlexPosn TokenClass String
show/hide Instances
Functions +
scanner :: String -> Either String [Token]
scanner. Tokenizes a String into an array of tokens +
Produced by Haddock version 0.8
hunk ./api/Parser-ParseErr.html 1 + + +Parser.ParseErr
 hburgContentsIndex
Parser.ParseErr
Contents
Functions +
Description

Author : Igor Boehm igor@bytelabs.org +

This module contains various error text generation functions. +

Synopsis
parseErrDupBind :: String -> Elem -> Elem -> String
parseErrRedefinition :: String -> Node -> Node -> String
parseErrTok :: Token -> String -> String
parseErrElem :: Elem -> String -> String
typeError :: Elem -> Int -> String -> String
Functions +
parseErrDupBind :: String -> Elem -> Elem -> String
parseErrDupBind. Produces error message when encountering + a duplicate binding. +
parseErrRedefinition :: String -> Node -> Node -> String
parseErrRedefinition. Produces error message upon the + redefinition of a Node. +
parseErrTok :: Token -> String -> String
parseErrTok. +
parseErrElem :: Elem -> String -> String
parseErrElem. Generic error message. +
typeError :: Elem -> Int -> String -> String
typeError. Produces error message upon type error. +
Produced by Haddock version 0.8
hunk ./api/Parser-Parser.html 1 + + +Parser.Parser
 hburgContentsIndex
Parser.Parser
Contents
Types +
Functions +
Description
The LR parser for our tree pattern matching grammar. It does some basic + semantic checking, e.g. duplicate bindings, type checking, etc. +
Synopsis
data ParseResult a
= ParseOk a
| ParseErr [String] a
| ParseFail String
Types +
data ParseResult a
ParseResult type +
Constructors
ParseOk aSuccessful parse +
ParseErr [String] aParse contained errors +
ParseFail StringFatal error happened +
show/hide Instances
Eq a => Eq (ParseResult a)
Ord a => Ord (ParseResult a)
Show a => Show (ParseResult a)
Functions +
Produced by Haddock version 0.8
hunk ./api/Util.html 1 + + +Util
 hburgContentsIndex
Util
Description

Author : Igor Boehm igor@bytelabs.org +

General utility functions. +

Synopsis
stringToInt :: String -> Int
stringToUpper :: String -> String
stringFoldr :: (String -> String -> String) -> [String] -> String
Documentation
stringToInt :: String -> Int
stringToInt. Convert String to Int. +
stringToUpper :: String -> String
stringToUpper. +
stringFoldr :: (String -> String -> String) -> [String] -> String
stringFoldr. +
Produced by Haddock version 0.8
hunk ./api/doc-index-A.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (A)
Arity
Attr
AttrTy
addChild
addLinkBlockCode
addSibling
addToEnv
argInfo
attrEqualInOut
attrGetIn
attrGetOut
attrId
attrIsOut
attrTy
hunk ./api/doc-index-B.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (B)
Binding
bye
byeStr
hunk ./api/doc-index-C.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (C)
CLIFlags
Closure
Code
ConToken
Cost
checkDef
checkEnv
childCallLabel
closureGetFromLabel
closureGetRuleLabel
closureGetToLabel
codeGen
constArgs
hunk ./api/doc-index-D.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (D)
Debug
Declaration
Definition
debug
defToEnumLabel
defToEvalLabel
die
dieCodeGen
hunk ./api/doc-index-E.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (E)
EDef
EIdent
ENonTerm
EOp
ETerm
EUnknown
Elem
ElemClass
ElemType
EmitClass
Env
elemC
elemId
elemL
elemShow
elemType
emit
1 (Function)
2 (Function)
emitTo
empty
1 (Function)
2 (Function)
emptyEnv
emptyNode
emptyTy
envElem
equalBindings
equalIdents
hunk ./api/doc-index-G.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (G)
genEnums
genEval
genMapEntry
genNodeInterface
genTiling
getArity
getAttr
1 (Function)
2 (Function)
getBinding
1 (Function)
2 (Function)
3 (Function)
getChildren
getClosures
1 (Function)
2 (Function)
getCode
getCost
getDefForProd
getElem
getId
getIdent
1 (Function)
2 (Function)
3 (Function)
4 (Function)
5 (Function)
getLink
getLinkSet
getName
1 (Function)
2 (Function)
3 (Function)
getNode
getNodeKindType
getNodeReturnType
getNonTerm
getOperatorsPerArity
getOutputClassName
getOutputPackage
getParams
getProds
getProdsByIdent
getProdsForArity
getProductionsPerArity
getResultLabel
getRetTy
getRuleLabel
getSem1
getSem2
getSem3
getSem4
getSem5
getSem6
getSiblings
getTerm
getTy
getType
hunk ./api/doc-index-H.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (H)
hasAttr
hasBinding
1 (Function)
2 (Function)
3 (Function)
4 (Function)
hasChildren
hasClosures
hasLink
hasSibling
hunk ./api/doc-index-I.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (I)
Ident
InAttr
Include
inEnv
isDefined
isEmpty
isNil
isNodeDefined
isNonTerm
isTerm
hunk ./api/doc-index-J.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (J)
JComment
JConstructor
JEnum
JMethod
JModifier
JParameter
JVariable
Java
JavaClass
jGetAdditionalClasses
jGetClassName
jGetComments
jGetConstructors
jGetEnumClasses
jGetImports
jGetMethods
jGetModifier
jGetNestedClasses
jGetPackage
jGetStaticInitializer
jGetUserCode
jGetVariables
jIsFinal
jIsIface
jIsStatic
jSetAdditionalClasses
jSetClassName
jSetComments
jSetConstructors
jSetEnumClasses
jSetFinal
jSetIface
jSetImports
jSetMethods
jSetModifier
jSetNestedClasses
jSetPackage
jSetStatic
jSetStaticInitializer
jSetUserCode
jSetVariables
java
hunk ./api/doc-index-L.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (L)
Label
LinkSet
hunk ./api/doc-index-M.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (M)
main
mapChildren
mapPreOrder
mapPreOrder2
mapPreOrder3
mergeDefs
mergeEnvs
mergeProds
hunk ./api/doc-index-N.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (N)
NoModifier
Node
NodeClass
Nt
new
1 (Function)
2 (Function)
3 (Function)
4 (Function)
5 (Function)
6 (Function)
7 (Function)
8 (Function)
9 (Function)
10 (Function)
11 (Function)
12 (Function)
13 (Function)
14 (Function)
15 (Function)
16 (Function)
17 (Function)
newEnv
newFromList
nonTerm
ntToEnumLabel
hunk ./api/doc-index-O.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (O)
Operator
OperatorsPerArity
OptDebug
OptHelp
OptNodeKindType
OptOutputClass
OptOutputPackage
OutAttr
op
opHasSem
opId
opMap
opSem
outputClass
hunk ./api/doc-index-P.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (P)
ParseErr
ParseFail
ParseOk
ParseResult
Private
Prod
ProductionsPerArity
Protected
Public
parse
parseErrDupBind
parseErrElem
parseErrRedefinition
parseErrTok
prod
prodToEnumLabel
hunk ./api/doc-index-R.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (R)
runParse
hunk ./api/doc-index-S.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (S)
scanner
setComment
setIfaceDef
setLink
setProds
setResultLabel
setRuleLabel
showAsFunction
showTokens
stringFoldr
stringToInt
stringToUpper
hunk ./api/doc-index-T.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (T)
T
TAssign
TAttrEnd
TAttrIdent
TAttrKeyword
TAttrStart
TBoxClose
TBoxOpen
TColon
TComma
TCost
TEOF
TIdent
TKeyword
TOr
TParenClose
TParenOpen
TPeriod
TSemAction
TTerm
TermTy
TermTyClass
Tiling
Token
TokenClass
Ty
tTyToEnumLabel
tTyToEvalLabel
term
toIdent
toOp
ty
typeError
hunk ./api/doc-index-U.html 1 + + +hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (U)
updateEnv
usageHeader
hunk ./api/doc-index.html 1 + + +hburg (Index)
 hburgContentsIndex
Index
ABCDEGHIJLMNOPRSTU
hunk ./api/haddock.css 1 +/* -------- Global things --------- */ + +BODY { + background-color: #ffffff; + color: #000000; + font-family: sans-serif; + } + +A:link { color: #0000e0; text-decoration: none } +A:visited { color: #0000a0; text-decoration: none } +A:hover { background-color: #e0e0ff; text-decoration: none } + +TABLE.vanilla { + width: 100%; + border-width: 0px; + /* I can't seem to specify cellspacing or cellpadding properly using CSS... */ +} + +TABLE.vanilla2 { + border-width: 0px; +} + +/* font is a little too small in MSIE */ +TT { font-size: 100%; } +PRE { font-size: 100%; } + +LI P { margin: 0pt } + +TD { + border-width: 0px; +} + +TABLE.narrow { + border-width: 0px; +} + +TD.s8 { height: 8px; } +TD.s15 { height: 15px; } + +SPAN.keyword { text-decoration: underline; } + +/* Resize the buttom image to match the text size */ +IMG.coll { width : 0.75em; height: 0.75em; margin-bottom: 0; margin-right: 0.5em } + +/* --------- Contents page ---------- */ + +DIV.node { + padding-left: 3em; +} + +DIV.cnode { + padding-left: 1.75em; +} + +SPAN.pkg { + position: absolute; + left: 50em; +} + +/* --------- Documentation elements ---------- */ + +TD.children { + padding-left: 25px; + } + +TD.synopsis { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace + } + +TD.decl { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace; + vertical-align: top; + } + +TD.topdecl { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace; + vertical-align: top; +} + +TABLE.declbar { + border-spacing: 0px; + } + +TD.declname { + width: 100%; + } + +TD.declbut { + padding-left: 5px; + padding-right: 5px; + border-left-width: 1px; + border-left-color: #000099; + border-left-style: solid; + white-space: nowrap; + font-size: small; + } + +/* + arg is just like decl, except that wrapping is not allowed. It is + used for function and constructor arguments which have a text box + to the right, where if wrapping is allowed the text box squashes up + the declaration by wrapping it. +*/ +TD.arg { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace; + vertical-align: top; + white-space: nowrap; + } + +TD.recfield { padding-left: 20px } + +TD.doc { + padding-top: 2px; + padding-left: 10px; + } + +TD.ndoc { + padding: 2px; + } + +TD.rdoc { + padding: 2px; + padding-left: 10px; + width: 100%; + } + +TD.body { + padding-left: 10px + } + +TD.pkg { + width: 100%; + padding-left: 10px +} + +TD.indexentry { + vertical-align: top; + padding-right: 10px + } + +TD.indexannot { + vertical-align: top; + padding-left: 20px; + white-space: nowrap + } + +TD.indexlinks { + width: 100% + } + +/* ------- Section Headings ------- */ + +TD.section1 { + padding-top: 15px; + font-weight: bold; + font-size: 150% + } + +TD.section2 { + padding-top: 10px; + font-weight: bold; + font-size: 130% + } + +TD.section3 { + padding-top: 5px; + font-weight: bold; + font-size: 110% + } + +TD.section4 { + font-weight: bold; + font-size: 100% + } + +/* -------------- The title bar at the top of the page */ + +TD.infohead { + color: #ffffff; + font-weight: bold; + padding-right: 10px; + text-align: left; +} + +TD.infoval { + color: #ffffff; + padding-right: 10px; + text-align: left; +} + +TD.topbar { + background-color: #000099; + padding: 5px; +} + +TD.title { + color: #ffffff; + padding-left: 10px; + width: 100% + } + +TD.topbut { + padding-left: 5px; + padding-right: 5px; + border-left-width: 1px; + border-left-color: #ffffff; + border-left-style: solid; + white-space: nowrap; + } + +TD.topbut A:link { + color: #ffffff + } + +TD.topbut A:visited { + color: #ffff00 + } + +TD.topbut A:hover { + background-color: #6060ff; + } + +TD.topbut:hover { + background-color: #6060ff + } + +TD.modulebar { + background-color: #0077dd; + padding: 5px; + border-top-width: 1px; + border-top-color: #ffffff; + border-top-style: solid; + } + +/* --------- The page footer --------- */ + +TD.botbar { + background-color: #000099; + color: #ffffff; + padding: 5px + } +TD.botbar A:link { + color: #ffffff; + text-decoration: underline + } +TD.botbar A:visited { + color: #ffff00 + } +TD.botbar A:hover { + background-color: #6060ff + } + hunk ./api/haddock.js 1 +// Haddock JavaScript utilities +function toggle(button,id) +{ + var n = document.getElementById(id).style; + if (n.display == "none") + { + button.src = "minus.gif"; + n.display = "block"; + } + else + { + button.src = "plus.gif"; + n.display = "none"; + } +} binary ./api/haskell_icon.gif oldhex * newhex *47494638376110001000f70f00000000800000008000808000000080800080008080c0c0c08080 *80ff000000ff00ffff000000ffff00ff00ffffffffff0000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *0021f90401000000002c000000001000100007086c0001007840b0a0418202073e38b0b021c387 *07143e2440c0a143040e091cd0787021c686151f84347800e343901d4b12646870e44a930d0952 *3ca832a6cc990555b2bc2992e4c79d3847ea2c88b3a7c89a2c8b8aa43874e941a60810003840b5 *aa55aa511346ddca75abc080003b hunk ./api/index.html 1 + + +hburg
 hburgContentsIndex
Modules
show/hideAst
Ast.Attr
Ast.Bind
Ast.Code
Ast.Decl
Ast.Def
Ast.Ident
Ast.Incl
Ast.Node
Ast.Nt
Ast.Op
Ast.Prod
Ast.T
Ast.TermTy
show/hideCsa
Csa.Csa
Debug
show/hideEnv
Env.Elem
Env.Env
show/hideGen
show/hideGen.Emit
Gen.Emit.EmitClass
Gen.Emit.EmitEnums
Gen.Emit.EmitEval
Gen.Emit.EmitMapEntry
Gen.Emit.EmitNodeIf
Gen.Emit.EmitTiling
show/hideJava
Gen.Emit.Java.JComment
Gen.Emit.Java.JConstructor
Gen.Emit.Java.JEnum
Gen.Emit.Java.JMethod
Gen.Emit.Java.JModifier
Gen.Emit.Java.JParameter
Gen.Emit.Java.JVariable
Gen.Emit.Java.Java
Gen.Emit.JavaClass
Gen.Emit.Label
Gen.Emit.Tiling
Main
show/hideParser
Parser.Lexer
Parser.ParseErr
Parser.Parser
Util
Produced by Haddock version 0.8
binary ./api/minus.gif oldhex * newhex *47494638396109000900910000fefefe8282820202020000002c00000000090009000002118c8f *a00bc6eb5e0b40583b6596f1a11f14003b binary ./api/plus.gif oldhex * newhex *47494638396109000900910000fefefe8282820202020000002c00000000090009000002148c8f *a00bb6b29c82ca897b5b7871cfce74085200003b hunk ./src/Ast/Decl.hs 15 - -- $intro hunk ./src/Ast/Decl.hs 16 - -- * Construction - -- $construction + -- * Construction hunk ./src/Ast/Node.hs 278 -mapPreOrder3 :: (Int -> Node -> [a]) -> -- ^ path accumulation function - ([a] -> Node -> [b]) -> -- ^ do this before recursing in pre order - ([a] -> Node -> [b]) -> -- ^ do this after returning from pre order recursion - Node -> -- ^ current node - [([a], [b], Node)] -- ^ return type +mapPreOrder3 :: (Int -> Node -> [a]) -- ^ path accumulation function + -> ([a] -> Node -> [b]) -- ^ do this before recursing in pre order + -> ([a] -> Node -> [b]) -- ^ do this after returning from pre order recursion + -> Node -- ^ current node + -> [([a], [b], Node)] -- ^ return type hunk ./src/Ast/Nt.hs 33 -data Nt - = Nt - Id.Ident -- ^ Id identifying this non terminal (e.g. reg, stmt) - B.Binding -- ^ binding for this non terminal (e.g. reg r1) - [Attr] -- ^ list of attributes for this non terminal +data Nt + = Nt + Id.Ident -- Id identifying this non terminal (e.g. reg, stmt) + B.Binding -- binding for this non terminal (e.g. reg r1) + [Attr] -- list of attributes for this non terminal hunk ./src/Ast/T.hs 35 - Id.Ident -- ^ Id identifying this terminal (e.g. ADD, SUB, etc.) - B.Binding -- ^ binding for this terminsl (e.g. ADD a1) + Id.Ident -- Id identifying this terminal (e.g. ADD, SUB, etc.) + B.Binding -- binding for this terminsl (e.g. ADD a1) hunk ./src/Gen/Emit/Java/JConstructor.hs 31 - Comment.JComment -- ^ comment - JModifier -- ^ private|public|protected modifier - String -- ^ constructor identifier - [Parameter] -- ^ constructor parameters - Body -- ^ constructor body + Comment.JComment -- comment + JModifier -- private|public|protected modifier + String -- constructor identifier + [Parameter] -- constructor parameters + Body -- constructor body hunk ./src/Gen/Emit/Java/JEnum.hs 13 - -- * Introduction - -- $intro + -- * Types hunk ./src/Gen/Emit/Java/JEnum.hs 15 - -- * Construction - -- $construction + -- * Construction hunk ./src/Gen/Emit/Java/JEnum.hs 26 - JModifier -- ^ public|private|protected modifier - String -- ^ enumeration identifier - [String] -- ^ enumeration elements + JModifier -- public|private|protected modifier + String -- enumeration identifier + [String] -- enumeration elements hunk ./src/Gen/Emit/Java/JVariable.hs 28 - JModifier -- ^ private|public|protected modifier - Bool -- ^ is it static? - Type -- ^ variable type - String -- ^ variable identifier - Constructor -- ^ how to construct the variable (e.g. new EnumSet.of(blablabla)) + JModifier -- private|public|protected modifier + Bool -- is it static? + Type -- variable type + String -- variable identifier + Constructor -- how to construct the variable (e.g. new EnumSet.of(blablabla)) hunk ./src/Gen/Emit/Tiling.hs 57 - Arity -- ^ key: arity of operator - (S.Set Operator)) -- ^ operators + Arity -- key: arity of operator + (S.Set Operator)) -- operators hunk ./src/Gen/Emit/Tiling.hs 63 - Arity -- ^ key: arity of the node - [Prod]) -- ^ value: the production itself + Arity -- key: arity of the node + [Prod]) -- value: the production itself hunk ./src/Gen/Emit/Tiling.hs 69 - [Closure] -- ^ list of closures for this tiling - OperatorsPerArity -- ^ holds all operators keyed by the arity of the production (used to calc. EnumSets) - LinkSet -- ^ the link set - ProductionsPerArity -- ^ holds all productions with the label they produced, and are keyed by the arity of the production + [Closure] -- list of closures for this tiling + OperatorsPerArity -- holds all operators keyed by the arity of the production (used to calc. EnumSets) + LinkSet -- the link set + ProductionsPerArity -- holds all productions with the label they produced, and are keyed by the arity of the production }