[Introduced Hburg namespace and performed some naming improvements igor@bytelabs.org**20080730095632] { move ./src/Gen/Emit/Java ./src/Gen/Java move ./src/Gen/Emit/Label.hs ./src/Gen/Label.hs move ./src/Gen/Java/Generator.hs ./src/Gen/Java/Gen.hs rmdir ./src/Gen/Emit adddir ./src/Hburg move ./src/Ast ./src/Hburg/Ast move ./src/Csa ./src/Hburg/Csa move ./src/Debug.hs ./src/Hburg/Debug.hs move ./src/Gen ./src/Hburg/Gen move ./src/Parser/Messages.hs ./src/Parser/Msg.hs move ./src/Parser ./src/Hburg/Parse move ./src/Util.hs ./src/Hburg/Util.hs addfile ./src/Hburg/Gen/Doc.hs hunk ./TODO 33 - * Use pretty-printer library in code generator. - 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
rmfile ./api/Ast-Attr.html 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
rmfile ./api/Ast-Bind.html 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
rmfile ./api/Ast-Code.html 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
rmfile ./api/Ast-Decl.html 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
rmfile ./api/Ast-Def.html 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
rmfile ./api/Ast-Ident.html 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
rmfile ./api/Ast-Incl.html 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
rmfile ./api/Ast-Node.html 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
rmfile ./api/Ast-Nt.html 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
rmfile ./api/Ast-Op.html 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
rmfile ./api/Ast-Prod.html 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
rmfile ./api/Ast-T.html 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
rmfile ./api/Ast-TermTy.html 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
rmfile ./api/Csa-Csa.html 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
rmfile ./api/Debug.html 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
rmfile ./api/Env-Elem.html 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
rmfile ./api/Env-Env.html 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
rmfile ./api/Gen-Emit-EmitClass.html 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
rmfile ./api/Gen-Emit-EmitEnums.html 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
rmfile ./api/Gen-Emit-EmitEval.html 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
rmfile ./api/Gen-Emit-EmitMapEntry.html 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
rmfile ./api/Gen-Emit-EmitNodeIf.html 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
rmfile ./api/Gen-Emit-EmitTiling.html 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
rmfile ./api/Gen-Emit-Java-JComment.html 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
rmfile ./api/Gen-Emit-Java-JConstructor.html 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
rmfile ./api/Gen-Emit-Java-JEnum.html 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
rmfile ./api/Gen-Emit-Java-JMethod.html 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
rmfile ./api/Gen-Emit-Java-JModifier.html 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
rmfile ./api/Gen-Emit-Java-JParameter.html 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
rmfile ./api/Gen-Emit-Java-JVariable.html 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
rmfile ./api/Gen-Emit-Java-Java.html 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
rmfile ./api/Gen-Emit-JavaClass.html 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
rmfile ./api/Gen-Emit-Label.html 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
rmfile ./api/Gen-Emit-Tiling.html 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
rmfile ./api/Gen-Emit.html 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
rmfile ./api/Main.html 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
rmfile ./api/Parser-Lexer.html 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
rmfile ./api/Parser-ParseErr.html 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
rmfile ./api/Parser-Parser.html 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
rmfile ./api/Util.html 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
rmfile ./api/doc-index-A.html hunk ./api/doc-index-B.html 1 - - -hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (B)
Binding
bye
byeStr
rmfile ./api/doc-index-B.html 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
rmfile ./api/doc-index-C.html hunk ./api/doc-index-D.html 1 - - -hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (D)
Debug
Declaration
Definition
debug
defToEnumLabel
defToEvalLabel
die
dieCodeGen
rmfile ./api/doc-index-D.html 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
rmfile ./api/doc-index-E.html 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
rmfile ./api/doc-index-G.html 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
rmfile ./api/doc-index-H.html hunk ./api/doc-index-I.html 1 - - -hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (I)
Ident
InAttr
Include
inEnv
isDefined
isEmpty
isNil
isNodeDefined
isNonTerm
isTerm
rmfile ./api/doc-index-I.html 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
rmfile ./api/doc-index-J.html hunk ./api/doc-index-L.html 1 - - -hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (L)
Label
LinkSet
rmfile ./api/doc-index-L.html hunk ./api/doc-index-M.html 1 - - -hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (M)
main
mapChildren
mapPreOrder
mapPreOrder2
mapPreOrder3
mergeDefs
mergeEnvs
mergeProds
rmfile ./api/doc-index-M.html 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
rmfile ./api/doc-index-N.html 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
rmfile ./api/doc-index-O.html 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
rmfile ./api/doc-index-P.html hunk ./api/doc-index-R.html 1 - - -hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (R)
runParse
rmfile ./api/doc-index-R.html 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
rmfile ./api/doc-index-S.html 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
rmfile ./api/doc-index-T.html hunk ./api/doc-index-U.html 1 - - -hburg (Index)
 hburgContentsIndex
ABCDEGHIJLMNOPRSTU
Index (U)
updateEnv
usageHeader
rmfile ./api/doc-index-U.html hunk ./api/doc-index.html 1 - - -hburg (Index)
 hburgContentsIndex
Index
ABCDEGHIJLMNOPRSTU
rmfile ./api/doc-index.html 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 - } - rmfile ./api/haddock.css 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"; - } -} rmfile ./api/haddock.js binary ./api/haskell_icon.gif oldhex *47494638376110001000f70f00000000800000008000808000000080800080008080c0c0c08080 *80ff000000ff00ffff000000ffff00ff00ffffffffff0000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *0021f90401000000002c000000001000100007086c0001007840b0a0418202073e38b0b021c387 *07143e2440c0a143040e091cd0787021c686151f84347800e343901d4b12646870e44a930d0952 *3ca832a6cc990555b2bc2992e4c79d3847ea2c88b3a7c89a2c8b8aa43874e941a60810003840b5 *aa55aa511346ddca75abc080003b newhex * rmfile ./api/haskell_icon.gif 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
rmfile ./api/index.html binary ./api/minus.gif oldhex *47494638396109000900910000fefefe8282820202020000002c00000000090009000002118c8f *a00bc6eb5e0b40583b6596f1a11f14003b newhex * rmfile ./api/minus.gif binary ./api/plus.gif oldhex *47494638396109000900910000fefefe8282820202020000002c00000000090009000002148c8f *a00bb6b29c82ca897b5b7871cfce74085200003b newhex * rmfile ./api/plus.gif rmdir ./api hunk ./hburg.cabal 58 - Util - Debug - Ast.Attr - Ast.Bind - Ast.Code - Ast.Closure - Ast.Cost - Ast.Decl - Ast.Def - Ast.Ident - Ast.Incl - Ast.Ir - Ast.Node - Ast.Nt - Ast.Op - Ast.Prod - Ast.T - Ast.Term - Csa.Csa - Csa.Ctx - Csa.Elem - Gen.Emit - Gen.Backend - Gen.Ident - Gen.Document - Gen.Emit.Label - Gen.Emit.Java.Generator - Gen.Emit.Java.Enum - Gen.Emit.Java.Eval - Gen.Emit.Java.Tile - Gen.Emit.Java.Class - Gen.Emit.Java.Method - Gen.Emit.Java.Modifier - Gen.Emit.Java.Param - Gen.Emit.Java.Var - Parser.Lexer - Parser.Parser - Parser.Messages + Hburg.Ast.Attr + Hburg.Ast.Bind + Hburg.Ast.Closure + Hburg.Ast.Code + Hburg.Ast.Cost + Hburg.Ast.Decl + Hburg.Ast.Def + Hburg.Ast.Ident + Hburg.Ast.Incl + Hburg.Ast.Ir + Hburg.Ast.Node + Hburg.Ast.Nt + Hburg.Ast.Op + Hburg.Ast.Prod + Hburg.Ast.T + Hburg.Ast.Term + Hburg.Csa.Csa + Hburg.Csa.Ctx + Hburg.Csa.Elem + Hburg.Debug + Hburg.Gen.Backend + Hburg.Gen.Doc + Hburg.Gen.Emit + Hburg.Gen.Ident + Hburg.Gen.Java.Class + Hburg.Gen.Java.Enum + Hburg.Gen.Java.Eval + Hburg.Gen.Java.Gen + Hburg.Gen.Java.Method + Hburg.Gen.Java.Modifier + Hburg.Gen.Java.Param + Hburg.Gen.Java.Tile + Hburg.Gen.Java.Var + Hburg.Gen.Label + Hburg.Parse.Lexer + Hburg.Parse.Msg + Hburg.Parse.Parser + Hburg.Util + hunk ./src/Hburg/Ast/Attr.hs 14 -module Ast.Attr ( +module Hburg.Ast.Attr ( hunk ./src/Hburg/Ast/Attr.hs 26 -import qualified Ast.Ident as Id (Ident) +import qualified Hburg.Ast.Ident as Id (Ident) hunk ./src/Hburg/Ast/Bind.hs 15 -module Ast.Bind ( +module Hburg.Ast.Bind ( hunk ./src/Hburg/Ast/Bind.hs 26 -import qualified Ast.Ident as Id (Ident) +import qualified Hburg.Ast.Ident as Id (Ident) hunk ./src/Hburg/Ast/Closure.hs 17 -module Ast.Closure ( +module Hburg.Ast.Closure ( hunk ./src/Hburg/Ast/Closure.hs 32 -import qualified Ast.Term as Term (TermClass(..)) -import qualified Ast.Def as Def (Definition, getProds) -import qualified Ast.Cost as C (Cost) -import qualified Ast.Prod as P (getResultLabel, getRuleLabel, getCost) -import qualified Gen.Emit.Label as L (termToEnumLab) +import qualified Hburg.Ast.Term as Term (TermClass(..)) +import qualified Hburg.Ast.Def as Def (Definition, getProds) +import qualified Hburg.Ast.Cost as C (Cost) +import qualified Hburg.Ast.Prod as P (getResultLabel, getRuleLabel, getCost) +import qualified Hburg.Gen.Label as L (termToEnum) hunk ./src/Hburg/Ast/Closure.hs 70 - (L.termToEnumLab p) -- alter at key + (L.termToEnum p) -- alter at key hunk ./src/Hburg/Ast/Code.hs 13 -module Ast.Code ( +module Hburg.Ast.Code ( hunk ./src/Hburg/Ast/Cost.hs 12 -module Ast.Cost ( +module Hburg.Ast.Cost ( hunk ./src/Hburg/Ast/Cost.hs 21 -import Ast.Code (Code) +import Hburg.Ast.Code (Code) hunk ./src/Hburg/Ast/Decl.hs 13 -module Ast.Decl ( +module Hburg.Ast.Decl ( hunk ./src/Hburg/Ast/Decl.hs 21 -import Ast.Code(Code) +import Hburg.Ast.Code(Code) hunk ./src/Hburg/Ast/Def.hs 16 -module Ast.Def ( +module Hburg.Ast.Def ( hunk ./src/Hburg/Ast/Def.hs 31 -import Ast.Attr (Attr, attrEqualInOut) -import Ast.Node (Node, getTerm) -import Ast.Term (TermClass(..)) -import Ast.Code (Code) +import Hburg.Ast.Attr (Attr, attrEqualInOut) +import Hburg.Ast.Node (Node, getTerm) +import Hburg.Ast.Term (TermClass(..)) +import Hburg.Ast.Code (Code) hunk ./src/Hburg/Ast/Def.hs 37 -import qualified Ast.Ident as Id (Ident) -import qualified Ast.Bind as B (empty) -import qualified Ast.Nt as Nt (Nt, new, getIdent, getAttr, getBinding, hasBinding) -import qualified Ast.Prod as P (Production, isDefined) +import qualified Hburg.Ast.Ident as Id (Ident) +import qualified Hburg.Ast.Bind as B (empty) +import qualified Hburg.Ast.Nt as Nt (Nt, new, getIdent, getAttr, getBinding, hasBinding) +import qualified Hburg.Ast.Prod as P (Production, isDefined) hunk ./src/Hburg/Ast/Def.hs 42 -import qualified Csa.Elem as E (ElemClass(..), ElemType(EDef)) +import qualified Hburg.Csa.Elem as E (ElemClass(..), ElemType(EDef)) hunk ./src/Hburg/Ast/Ident.hs 14 -module Ast.Ident ( +module Hburg.Ast.Ident ( hunk ./src/Hburg/Ast/Ident.hs 23 -import Parser.Lexer (Token(..)) +import Hburg.Parse.Lexer (Token(..)) hunk ./src/Hburg/Ast/Ident.hs 26 -import qualified Csa.Elem as E (ElemClass(..), ElemType(EIdent)) +import qualified Hburg.Csa.Elem as E (ElemClass(..), ElemType(EIdent)) hunk ./src/Hburg/Ast/Incl.hs 12 -module Ast.Incl ( +module Hburg.Ast.Incl ( hunk ./src/Hburg/Ast/Incl.hs 20 -import Ast.Code(Code) +import Hburg.Ast.Code(Code) hunk ./src/Hburg/Ast/Ir.hs 12 -module Ast.Ir ( +module Hburg.Ast.Ir ( hunk ./src/Hburg/Ast/Ir.hs 22 -import Ast.Term (TermClass(..)) +import Hburg.Ast.Term (TermClass(..)) hunk ./src/Hburg/Ast/Ir.hs 28 -import qualified Debug as Debug (Entry) -import qualified Ast.Incl as Incl (Include) -import qualified Ast.Op as Op (Operator) -import qualified Ast.Decl as Decl (Declaration) -import qualified Ast.Def as Def (Definition, getProds, getDefForProd) -import qualified Ast.Prod as Prod (Production, getArity, toOp, getNode) -import qualified Ast.Node as N (hasLink) +import qualified Hburg.Debug as Debug (Entry) +import qualified Hburg.Ast.Incl as Incl (Include) +import qualified Hburg.Ast.Op as Op (Operator) +import qualified Hburg.Ast.Decl as Decl (Declaration) +import qualified Hburg.Ast.Def as Def (Definition, getProds, getDefForProd) +import qualified Hburg.Ast.Prod as Prod (Production, getArity, toOp, getNode) +import qualified Hburg.Ast.Node as N (hasLink) hunk ./src/Hburg/Ast/Node.hs 13 -module Ast.Node ( +module Hburg.Ast.Node ( hunk ./src/Hburg/Ast/Node.hs 29 -import Ast.Term (Term, TermClass(..)) +import Hburg.Ast.Term (Term, TermClass(..)) hunk ./src/Hburg/Ast/Node.hs 34 -import qualified Ast.Code as C (Code, empty) +import qualified Hburg.Ast.Code as C (Code, empty) hunk ./src/Hburg/Ast/Node.hs 36 -import qualified Csa.Elem as E (ElemClass(..), ElemType(EUnknown)) +import qualified Hburg.Csa.Elem as E (ElemClass(..), ElemType(EUnknown)) hunk ./src/Hburg/Ast/Node.hs 117 - hunk ./src/Hburg/Ast/Node.hs 237 -mapPreOrder2 :: (Int -> Node -> [a]) -> -- ^ path accumulation function - (Node -> b) -> -- ^ do this before recursing in pre order - Node -> -- ^ current node - [([a], b)] -- ^ return type +mapPreOrder2 :: (Int -> Node -> [a]) -- ^ path accumulation function + -> (Node -> b) -- ^ do this before recursing in pre order + -> Node -- ^ current node + -> [([a], b)] -- ^ return type hunk ./src/Hburg/Ast/Node.hs 247 - accumMap :: (Int -> Node -> [a]) -> - (Node -> b) -> - Int -> - [a] -> - Node -> - [([a], b)] + accumMap :: (Int -> Node -> [a]) + -> (Node -> b) + -> Int + -> [a] + -> Node + -> [([a], b)] hunk ./src/Hburg/Ast/Node.hs 266 -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/Hburg/Ast/Node.hs 277 - accumMap :: (Int -> Node -> [a]) -> - ([a] -> Node -> [b]) -> - ([a] -> Node -> [b]) -> - Int -> - [a] -> - Node -> - [([a], [b], Node)] + accumMap :: (Int -> Node -> [a]) + -> ([a] -> Node -> [b]) + -> ([a] -> Node -> [b]) + -> Int + -> [a] + -> Node + -> [([a], [b], Node)] hunk ./src/Hburg/Ast/Nt.hs 11 -module Ast.Nt ( +module Hburg.Ast.Nt ( hunk ./src/Hburg/Ast/Nt.hs 21 -import Ast.Attr(Attr, attrIsOut) +import Hburg.Ast.Attr(Attr, attrIsOut) hunk ./src/Hburg/Ast/Nt.hs 24 -import qualified Ast.Ident as Id (Ident) -import qualified Ast.Bind as B (Binding, hasBinding) +import qualified Hburg.Ast.Ident as Id (Ident) +import qualified Hburg.Ast.Bind as B (Binding, hasBinding) hunk ./src/Hburg/Ast/Nt.hs 27 -import qualified Csa.Elem as E (ElemClass(..),ElemType(ENonTerm)) +import qualified Hburg.Csa.Elem as E (ElemClass(..),ElemType(ENonTerm)) hunk ./src/Hburg/Ast/Op.hs 18 -module Ast.Op ( +module Hburg.Ast.Op ( hunk ./src/Hburg/Ast/Op.hs 29 -import qualified Ast.Ident as Id (Ident) -import qualified Ast.Code as C (Code, new) +import qualified Hburg.Ast.Ident as Id (Ident) +import qualified Hburg.Ast.Code as C (Code, new) hunk ./src/Hburg/Ast/Op.hs 32 -import qualified Csa.Elem as E (ElemClass(..), ElemType(EOp)) +import qualified Hburg.Csa.Elem as E (ElemClass(..), ElemType(EOp)) hunk ./src/Hburg/Ast/Prod.hs 16 -module Ast.Prod ( +module Hburg.Ast.Prod ( hunk ./src/Hburg/Ast/Prod.hs 21 - getProdsByIdent,getArity,getNode,getCost, + getArity,getNode,getCost, hunk ./src/Hburg/Ast/Prod.hs 29 -import Ast.Op (Operator, op) -import Ast.Term (TermClass(..)) -import Ast.Cost (Cost) +import Hburg.Ast.Op (Operator, op) +import Hburg.Ast.Term (TermClass(..)) +import Hburg.Ast.Cost (Cost) hunk ./src/Hburg/Ast/Prod.hs 34 -import qualified Ast.Node as N (Node, TreeClass(getChildren)) +import qualified Hburg.Ast.Node as N (Node, TreeClass(getChildren)) hunk ./src/Hburg/Ast/Prod.hs 36 -import qualified Csa.Elem as E (ElemClass(..), ElemType(EProd)) +import qualified Hburg.Csa.Elem as E (ElemClass(..), ElemType(EProd)) hunk ./src/Hburg/Ast/Prod.hs 119 -{- | Retrieves all productions which have the same identifier -} -getProdsByIdent :: [Production] -> N.Node -> [Production] -getProdsByIdent [] _ = [] -getProdsByIdent prods n = filter (\p -> getId p == getId n) (prods) - hunk ./src/Hburg/Ast/T.hs 11 -module Ast.T ( +module Hburg.Ast.T ( hunk ./src/Hburg/Ast/T.hs 24 -import qualified Ast.Ident as Id (Ident) -import qualified Ast.Bind as B (Binding, hasBinding) +import qualified Hburg.Ast.Ident as Id (Ident) +import qualified Hburg.Ast.Bind as B (Binding, hasBinding) hunk ./src/Hburg/Ast/T.hs 27 -import qualified Csa.Elem as E (ElemClass(..),ElemType(ETerm)) +import qualified Hburg.Csa.Elem as E (ElemClass(..),ElemType(ETerm)) hunk ./src/Hburg/Ast/Term.hs 12 -module Ast.Term ( +module Hburg.Ast.Term ( hunk ./src/Hburg/Ast/Term.hs 21 -import Ast.Bind (Binding) -import Ast.Attr (Attr) +import Hburg.Ast.Bind (Binding) +import Hburg.Ast.Attr (Attr) hunk ./src/Hburg/Ast/Term.hs 25 -import qualified Ast.Ident as Id (Ident) -import qualified Ast.T as T (T, getIdent, getBinding, hasBinding) -import qualified Ast.Nt as Nt (Nt, getIdent, getAttr, getBinding, hasBinding) +import qualified Hburg.Ast.Ident as Id (Ident) +import qualified Hburg.Ast.T as T (T, getIdent, getBinding, hasBinding) +import qualified Hburg.Ast.Nt as Nt (Nt, getIdent, getAttr, getBinding, hasBinding) hunk ./src/Hburg/Ast/Term.hs 29 -import qualified Csa.Elem as E (ElemClass(..)) +import qualified Hburg.Csa.Elem as E (ElemClass(..)) hunk ./src/Hburg/Csa/Csa.hs 14 -module Csa.Csa ( +module Hburg.Csa.Csa ( hunk ./src/Hburg/Csa/Csa.hs 25 -import Ast.Term (Term, TermClass(..)) -import Parser.Messages (parseErrElem, typeErr) +import Hburg.Ast.Term (Term, TermClass(..)) +import Hburg.Parse.Msg (parseErrElem, typeErr) hunk ./src/Hburg/Csa/Csa.hs 33 -import qualified Ast.Ident as Id (Ident) -import qualified Ast.Node as N (Node, TreeClass(..), getLink, showAsFun, mapPreOrder) -import qualified Ast.Bind as B (getIdent) -import qualified Ast.Prod as P (Production, getNode, getProdsByIdent) -import qualified Ast.Def as D (Definition, getProds, isNodeDefined) +import qualified Hburg.Ast.Ident as Id (Ident) +import qualified Hburg.Ast.Node as N (Node, TreeClass(..), getLink, showAsFun, mapPreOrder) +import qualified Hburg.Ast.Bind as B (getIdent) +import qualified Hburg.Ast.Prod as P (Production, getNode) +import qualified Hburg.Ast.Def as D (Definition, getProds, isNodeDefined) hunk ./src/Hburg/Csa/Csa.hs 39 -import qualified Csa.Ctx as Ctx (Ctx, merge, new, member) -import qualified Csa.Elem as E (ElemClass(..), Elem, new) +import qualified Hburg.Csa.Ctx as Ctx (Ctx, merge, new, member) +import qualified Hburg.Csa.Elem as E (ElemClass(..), Elem, new) hunk ./src/Hburg/Csa/Csa.hs 75 - (computeTypeSet d (filter (\x -> x /= d) ds) S.empty) + (computeTypeSet d (filter (/= d) ds) S.empty) hunk ./src/Hburg/Csa/Csa.hs 120 - computeTypeSet d' (filter (\x -> x /= d') ds) set' + computeTypeSet d' (filter (/= d') ds) set' hunk ./src/Hburg/Csa/Csa.hs 162 - (P.getProdsByIdent prods new) + -- productions that have the same identifier + (filter (\p -> getId p == getId new) (prods)) hunk ./src/Hburg/Csa/Ctx.hs 12 -module Csa.Ctx ( +module Hburg.Csa.Ctx ( hunk ./src/Hburg/Csa/Ctx.hs 21 -import Csa.Elem (Elem, ElemClass(..)) +import Hburg.Csa.Elem (Elem, ElemClass(..)) hunk ./src/Hburg/Csa/Elem.hs 13 -module Csa.Elem ( +module Hburg.Csa.Elem ( hunk ./src/Hburg/Debug.hs 11 -module Debug ( +module Hburg.Debug ( hunk ./src/Hburg/Gen/Backend.hs 13 -module Gen.Backend ( +module Hburg.Gen.Backend ( hunk ./src/Hburg/Gen/Backend.hs 21 -import qualified Ast.Ir as Ir (Ir(..), baseRuleMap, linkSet) +import qualified Hburg.Ast.Ir as Ir (Ir(..)) hunk ./src/Hburg/Gen/Backend.hs 23 -import qualified Gen.Ident as I (new) +import qualified Hburg.Gen.Ident as I (new) hunk ./src/Hburg/Gen/Backend.hs 25 -import qualified Gen.Emit.Java.Generator as Java (generate) -import qualified Gen.Emit.Java.Class as Class (Class) +import qualified Hburg.Gen.Java.Gen as J (generate) +import qualified Hburg.Gen.Java.Class as C (Class) hunk ./src/Hburg/Gen/Backend.hs 30 -type ClassName = String -type PackageName = String +type Class = String +type Package = String hunk ./src/Hburg/Gen/Backend.hs 35 -emit :: ClassName -> PackageName -> NodeKind -> Ir.Ir -> [Class.Class] -emit cname pkg nkind ir = Java.generate cname (I.new pkg) nkind ir +emit :: Class -> Package -> NodeKind -> Ir.Ir -> [C.Class] +emit cname pkg nkind ir = J.generate cname (I.new pkg) nkind ir hunk ./src/Hburg/Gen/Doc.hs 1 - +----------------------------------------------------------------------------- +-- | +-- Module : Document +-- Copyright : Copyright (c) 2008 - Bytelabs.org. All rights reserved. +-- License : BSD-style (see the file LICENSE) +-- Author : +-- +-- Any Type that should be used with the PrettyPrint module should +-- implement the toDoc function. +----------------------------------------------------------------------------- + +module Hburg.Gen.Doc ( + -- * Types + Document(..), + -- * Functions +) where + +{- unqualified imports -} +import Text.PrettyPrint (Doc) + +{- qualified imports -} + +----------------------------------------------------------------------------- + +{- | Whatever is an instance of Document can be turned into a Doc -} +class Document a where + toDoc :: a -> Doc + + toDocs :: [a] -> [Doc] + toDocs ds = map toDoc ds + +----------------------------------------------------------------------------- hunk ./src/Hburg/Gen/Emit.hs 11 -module Gen.Emit ( +module Hburg.Gen.Emit ( hunk ./src/Hburg/Gen/Ident.hs 12 -module Gen.Ident ( +module Hburg.Gen.Ident ( hunk ./src/Hburg/Gen/Ident.hs 29 - Id { pkgid :: String -- package identifier - , nid :: String -- node identifier - , nn :: String -- name of node moduel - , nty :: String -- node type - , ntid :: String -- nt identifier - , ntn :: String -- name of nt module - , ntty :: String -- nt type - , rid :: String -- rule identifier - , rn :: String -- name of rule module - , rty :: String -- rule type - , cid :: String -- cost identifier - , cn :: String -- name of cost module - , cty :: String -- cost type - , en :: String -- name of Entry module - , ety :: String } -- entry type + Id { pkgid :: String -- ^ package identifier + , nid :: String -- ^ node identifier + , nn :: String -- ^ name of node moduel + , nty :: String -- ^ node type + , ntid :: String -- ^ nt identifier + , ntn :: String -- ^ name of nt module + , ntty :: String -- ^ nt type + , rid :: String -- ^ rule identifier + , rn :: String -- ^ name of rule module + , rty :: String -- ^ rule type + , cid :: String -- ^ cost identifier + , cn :: String -- ^ name of cost module + , cty :: String -- ^ cost type + , en :: String -- ^ name of Entry module + , ety :: String } -- ^ entry type hunk ./src/Hburg/Gen/Java/Class.hs 12 -module Gen.Emit.Java.Class ( +module Hburg.Gen.Java.Class ( hunk ./src/Hburg/Gen/Java/Class.hs 25 -import Gen.Document (Document(..)) +import Hburg.Gen.Doc (Document(..)) hunk ./src/Hburg/Gen/Java/Class.hs 27 -import Gen.Emit (Emit(emit,emitTo)) -import Gen.Emit.Java.Enum as E (Enum) -import Gen.Emit.Java.Var (Var) -import Gen.Emit.Java.Modifier (Modifier(..)) +import Hburg.Gen.Emit (Emit(emit,emitTo)) +import Hburg.Gen.Java.Enum as E (Enum) +import Hburg.Gen.Java.Var (Var) +import Hburg.Gen.Java.Modifier (Modifier(..)) hunk ./src/Hburg/Gen/Java/Class.hs 33 -import qualified Gen.Emit.Java.Method as M (Method(..)) +import qualified Hburg.Gen.Java.Method as M (Method(..)) hunk ./src/Hburg/Gen/Java/Enum.hs 11 -module Gen.Emit.Java.Enum ( +module Hburg.Gen.Java.Enum ( hunk ./src/Hburg/Gen/Java/Enum.hs 23 -import Gen.Document (Document(..)) +import Hburg.Gen.Doc (Document(..)) hunk ./src/Hburg/Gen/Java/Enum.hs 25 -import Gen.Emit.Java.Modifier(Modifier) +import Hburg.Gen.Java.Modifier(Modifier) hunk ./src/Hburg/Gen/Java/Enum.hs 45 - <+> - lbrace - $+$ + <+> + lbrace $+$ hunk ./src/Hburg/Gen/Java/Enum.hs 53 - $+$ - rbrace + $+$ rbrace hunk ./src/Hburg/Gen/Java/Eval.hs 12 -module Gen.Emit.Java.Eval ( +module Hburg.Gen.Java.Eval ( hunk ./src/Hburg/Gen/Java/Eval.hs 23 -import Ast.Attr (attrGetIn, attrGetOut, attrId, attrTy) -import Ast.Term (TermClass(..)) -import Ast.Node (Node, Position(..), mapPreOrder3, getSemAct, hasLink, getLink) -import Ast.Prod (getRuleLabel, getNode) -import Ast.Def (Definition, getProds, getCode) +import Hburg.Ast.Attr (attrGetIn, attrGetOut, attrId, attrTy) +import Hburg.Ast.Term (TermClass(..)) +import Hburg.Ast.Node (Node, Position(..), mapPreOrder3, getSemAct, hasLink, getLink) +import Hburg.Ast.Prod (getRuleLabel, getNode) +import Hburg.Ast.Def (Definition, getProds, getCode) hunk ./src/Hburg/Gen/Java/Eval.hs 29 -import Gen.Emit.Label (termToEvalLab, termToEnumLab, childCallLab) -import Gen.Emit.Java.Modifier (Modifier(..)) +import Hburg.Gen.Java.Modifier (Modifier(..)) hunk ./src/Hburg/Gen/Java/Eval.hs 32 -import qualified Ast.Code as C (Code, isEmpty) -import qualified Ast.Ir as Ir (Ir(..)) +import qualified Hburg.Ast.Code as C (Code, isEmpty) +import qualified Hburg.Ast.Ir as Ir (Ir(..)) hunk ./src/Hburg/Gen/Java/Eval.hs 35 -import qualified Gen.Ident as I (Ident, rId, nId, nTy, rTy) -import qualified Gen.Emit.Java.Class as Class (Class(..), new) -import qualified Gen.Emit.Java.Method as Method (Method, new) -import qualified Gen.Emit.Java.Param as P (Param, new) +import qualified Hburg.Gen.Ident as I (Ident, rId, nId, nTy, rTy) +import qualified Hburg.Gen.Label as Lab (termToEval, termToEnum, childCall) +import qualified Hburg.Gen.Java.Class as Class (Class(..), new) +import qualified Hburg.Gen.Java.Method as M (Method, new) +import qualified Hburg.Gen.Java.Param as P (Param, new) hunk ./src/Hburg/Gen/Java/Eval.hs 83 -evalMethods :: I.Ident -> [Definition] -> [Method.Method] +evalMethods :: I.Ident -> [Definition] -> [M.Method] hunk ./src/Hburg/Gen/Java/Eval.hs 87 - Method.new Private True (returnType d) (termToEvalLab d) ps (body d)) + M.new Private True (returnType d) (Lab.termToEval d) ps (body d)) hunk ./src/Hburg/Gen/Java/Eval.hs 99 - <+> t (I.nId ids) <> t ".rule" <> parens (t $ termToEnumLab d) <> semi + <+> t (I.nId ids) <> t ".rule" <> parens (t $ Lab.termToEnum d) <> semi hunk ./src/Hburg/Gen/Java/Eval.hs 139 - (\pos n -> [t "." <> t (childCallLab pos) <> parens (empty)]) + (\pos n -> [t "." <> t (Lab.childCall pos) <> parens (empty)]) hunk ./src/Hburg/Gen/Java/Eval.hs 235 - t (termToEvalLab term) -- function name + t (Lab.termToEval term) -- function name hunk ./src/Hburg/Gen/Java/Gen.hs 3 --- Module : Generator +-- Module : Gen hunk ./src/Hburg/Gen/Java/Gen.hs 17 -module Gen.Emit.Java.Generator ( +module Hburg.Gen.Java.Gen ( hunk ./src/Hburg/Gen/Java/Gen.hs 28 -import Ast.Def (Definition, getProds, setProds) -import Ast.Prod (Production, setRuleLabel, setResultLabel) +import Hburg.Ast.Def (Definition, getProds, setProds) +import Hburg.Ast.Prod (Production, setRuleLabel, setResultLabel) hunk ./src/Hburg/Gen/Java/Gen.hs 31 -import Gen.Emit.Label (Label, prodToEnumLab, termToEnumLab) -import Gen.Emit.Java.Modifier (Modifier(..)) +import Hburg.Gen.Java.Modifier (Modifier(..)) hunk ./src/Hburg/Gen/Java/Gen.hs 37 -import qualified Ast.Ir as Ir (Ir(..), baseRuleMap, linkSet) +import qualified Hburg.Ast.Ir as Ir (Ir(..), baseRuleMap, linkSet) hunk ./src/Hburg/Gen/Java/Gen.hs 39 -import qualified Gen.Ident as I (Ident, pkgId, ntN, rN, nN, nTy, ntTy, rTy, eTy, cTy, eN, nId) -import qualified Gen.Emit.Java.Class as C (Class(..), new) -import qualified Gen.Emit.Java.Enum as E (Enum, new) -import qualified Gen.Emit.Java.Method as M (Method(..), new) -import qualified Gen.Emit.Java.Param as P (newFromList, getIdent) -import qualified Gen.Emit.Java.Var as V (new) -import qualified Gen.Emit.Java.Tile as Tile (tile) -import qualified Gen.Emit.Java.Eval as Eval (eval) +import qualified Hburg.Gen.Ident as I (Ident, pkgId, ntN, rN, nN, nTy, ntTy, rTy, eTy, cTy, eN, nId) +import qualified Hburg.Gen.Label as Lab (Label, prodToEnum, termToEnum) +import qualified Hburg.Gen.Java.Class as C (Class(..), new) +import qualified Hburg.Gen.Java.Enum as E (Enum, new) +import qualified Hburg.Gen.Java.Method as M (Method(..), new) +import qualified Hburg.Gen.Java.Param as P (fromList, getIdent) +import qualified Hburg.Gen.Java.Var as V (new) +import qualified Hburg.Gen.Java.Tile as Tile (tile) +import qualified Hburg.Gen.Java.Eval as Eval (eval) hunk ./src/Hburg/Gen/Java/Gen.hs 96 - ntEnums = E.new Public (I.ntN ids) (map (termToEnumLab) (Ir.definitions ir)) + ntEnums = E.new Public (I.ntN ids) (map (Lab.termToEnum) (Ir.definitions ir)) hunk ./src/Hburg/Gen/Java/Gen.hs 109 - labelProds :: Definition -> [Production] -> Int -> [(Production, Label)] + labelProds :: Definition -> [Production] -> Int -> [(Production, Lab.Label)] hunk ./src/Hburg/Gen/Java/Gen.hs 112 - let label = prodToEnumLab d p (show num) + let label = Lab.prodToEnum d p (show num) hunk ./src/Hburg/Gen/Java/Gen.hs 116 - modify (\p -> setResultLabel p $ termToEnumLab d)) + modify (\p -> setResultLabel p $ Lab.termToEnum d)) hunk ./src/Hburg/Gen/Java/Gen.hs 156 - [M.new Public False "boolean" "is" (P.newFromList [(I.ntTy ids,"nt")]) empty] ++ - [M.new Public False (I.eTy ids) "put" (P.newFromList [(I.ntTy ids,"nt"), (I.eTy ids,"entry")]) empty] ++ - [M.new Public False (I.eTy ids) "get" (P.newFromList [(I.ntTy ids,"nt")]) empty] ++ - [M.new Public False (I.cTy ids) "cost" (P.newFromList [(I.ntTy ids,"nt")]) empty] ++ - [M.new Public False (I.rTy ids) "rule" (P.newFromList [(I.ntTy ids,"nt")]) empty] + [M.new Public False "boolean" "is" (P.fromList [(I.ntTy ids,"nt")]) empty] ++ + [M.new Public False (I.eTy ids) "put" (P.fromList [(I.ntTy ids,"nt"), (I.eTy ids,"entry")]) empty] ++ + [M.new Public False (I.eTy ids) "get" (P.fromList [(I.ntTy ids,"nt")]) empty] ++ + [M.new Public False (I.cTy ids) "cost" (P.fromList [(I.ntTy ids,"nt")]) empty] ++ + [M.new Public False (I.rTy ids) "rule" (P.fromList [(I.ntTy ids,"nt")]) empty] hunk ./src/Hburg/Gen/Java/Gen.hs 171 - (P.newFromList [(I.cTy ids, "c"), (I.rTy ids,"r")]) + (P.fromList [(I.cTy ids, "c"), (I.rTy ids,"r")]) hunk ./src/Hburg/Gen/Java/Method.hs 11 -module Gen.Emit.Java.Method ( +module Hburg.Gen.Java.Method ( hunk ./src/Hburg/Gen/Java/Method.hs 21 -import Gen.Document (Document(..)) -import Gen.Emit.Java.Modifier (Modifier) -import Gen.Emit.Java.Param (Param) +import Hburg.Gen.Doc (Document(..)) +import Hburg.Gen.Java.Modifier (Modifier) +import Hburg.Gen.Java.Param (Param) hunk ./src/Hburg/Gen/Java/Method.hs 65 - (text . show $ modifier m) -- public|private|... + (text . show $ modifier m) -- public|private|... hunk ./src/Hburg/Gen/Java/Method.hs 69 - <+> text (retTy m) -- return type - <+> text (name m) -- method identifier - <> lparen <> -- parameters - (if (null $ params m) - then empty - else - foldr1 - (\p1 p2 -> p1 <> comma <+> p2) - (map (toDoc) $ params m)) <> - rparen + <+> text (retTy m) -- return type + <+> text (name m) -- method identifier + <> + lparen <> -- parameters + (if (null $ params m) + then empty + else + foldr1 + (\p1 p2 -> p1 <> comma <+> p2) + (map (toDoc) $ params m)) + <> rparen hunk ./src/Hburg/Gen/Java/Modifier.hs 11 -module Gen.Emit.Java.Modifier ( +module Hburg.Gen.Java.Modifier ( hunk ./src/Hburg/Gen/Java/Modifier.hs 19 -import Gen.Document (Document(..)) +import Hburg.Gen.Doc (Document(..)) hunk ./src/Hburg/Gen/Java/Param.hs 11 -module Gen.Emit.Java.Param ( +module Hburg.Gen.Java.Param ( hunk ./src/Hburg/Gen/Java/Param.hs 15 - new, newFromList, + new, fromList, hunk ./src/Hburg/Gen/Java/Param.hs 22 -import Gen.Document (Document(..)) +import Hburg.Gen.Doc (Document(..)) hunk ./src/Hburg/Gen/Java/Param.hs 42 --- | Constructor for building a new Param +{- | Constructor new Param -} hunk ./src/Hburg/Gen/Java/Param.hs 46 -newFromList :: [(Type, Ident)] -> [Param] -newFromList ps = map (\(ty, i) -> new ty i) (ps) +{- | Construct [Param] from a list -} +fromList :: [(Type, Ident)] -> [Param] +fromList ps = map (\(ty, i) -> new ty i) (ps) hunk ./src/Hburg/Gen/Java/Tile.hs 15 -module Gen.Emit.Java.Tile ( +module Hburg.Gen.Java.Tile ( hunk ./src/Hburg/Gen/Java/Tile.hs 25 -import Ast.Term (TermClass(..), nonTerminal) -import Ast.Op (Operator, opSem) -import Ast.Def (getNodeReturnType) -import Ast.Cost as Cost (isZero) -import Ast.Prod (Production, getCost, getNode, getRuleLabel, getResultLabel, getArity) +import Hburg.Ast.Term (TermClass(..), nonTerminal) +import Hburg.Ast.Op (Operator, opSem) +import Hburg.Ast.Def (getNodeReturnType) +import Hburg.Ast.Cost as Cost (isZero) +import Hburg.Ast.Prod (Production, getCost, getNode, getRuleLabel, getResultLabel, getArity) hunk ./src/Hburg/Gen/Java/Tile.hs 31 -import Gen.Emit.Label (termToEnumLab, childCallLab) -import Gen.Emit.Java.Modifier (Modifier(..)) +import Hburg.Gen.Java.Modifier (Modifier(..)) hunk ./src/Hburg/Gen/Java/Tile.hs 38 -import qualified Ast.Ident as Id (Ident) -import qualified Ast.Node as N (Node, mapPreOrder2) -import qualified Ast.Ir as Ir (Ir(..), baseRuleMap, linkSet) -import qualified Ast.Closure as Cl (Closure, Label(..), closure, fromLabels, toLabels, empty) +import qualified Hburg.Ast.Ident as Id (Ident) +import qualified Hburg.Ast.Node as N (Node, mapPreOrder2) +import qualified Hburg.Ast.Ir as Ir (Ir(..), baseRuleMap, linkSet) +import qualified Hburg.Ast.Closure as Cl (Closure, Label(..), closure, fromLabels, toLabels, empty) hunk ./src/Hburg/Gen/Java/Tile.hs 43 -import qualified Gen.Ident as I (Ident, ntId, rId, nId, cId, cTy, nTy, ntTy, rTy, eTy) -import qualified Gen.Emit.Java.Class as Class (Class(..), new) -import qualified Gen.Emit.Java.Method as M (Method, new) -import qualified Gen.Emit.Java.Var as V (Var, new) -import qualified Gen.Emit.Java.Param as Param (new, newFromList) +import qualified Hburg.Gen.Ident as I (Ident, ntId, rId, nId, cId, cTy, nTy, ntTy, rTy, eTy) +import qualified Hburg.Gen.Label as Lab (termToEnum, childCall) +import qualified Hburg.Gen.Java.Class as Class (Class(..), new) +import qualified Hburg.Gen.Java.Method as M (Method, new) +import qualified Hburg.Gen.Java.Var as V (Var, new) +import qualified Hburg.Gen.Java.Param as P (new, fromList) hunk ./src/Hburg/Gen/Java/Tile.hs 115 - M.new Public True "void" "tile" [Param.new (I.nTy ids) (I.nId ids)] body + M.new Public True "void" "tile" [P.new (I.nTy ids) (I.nId ids)] body hunk ./src/Hburg/Gen/Java/Tile.hs 143 - t ('.':(childCallLab pos)) <> parens empty <> semi) + t ('.':(Lab.childCall pos)) <> parens empty <> semi) hunk ./src/Hburg/Gen/Java/Tile.hs 153 - t ('.':(childCallLab pos)) <> parens empty) <> semi + t ('.':(Lab.childCall pos)) <> parens empty) <> semi hunk ./src/Hburg/Gen/Java/Tile.hs 164 - t ('.':(childCallLab pos)) <> parens empty) <> semi + t ('.':(Lab.childCall pos)) <> parens empty) <> semi hunk ./src/Hburg/Gen/Java/Tile.hs 189 - Param.newFromList + P.fromList hunk ./src/Hburg/Gen/Java/Tile.hs 246 - M.new Private True "void" (render $ labMethodName arity) [Param.new (I.nTy ids) (I.nId ids)] body + M.new Private True "void" (render $ labMethodName arity) [P.new (I.nTy ids) (I.nId ids)] body hunk ./src/Hburg/Gen/Java/Tile.hs 287 - simpleCase p = t "case" <+> t (termToEnumLab p) <> colon + simpleCase p = t "case" <+> t (Lab.termToEnum p) <> colon hunk ./src/Hburg/Gen/Java/Tile.hs 294 - complexCase prods = t "case" <+> t (termToEnumLab . head $ prods) <> colon + complexCase prods = t "case" <+> t (Lab.termToEnum . head $ prods) <> colon hunk ./src/Hburg/Gen/Java/Tile.hs 313 - (\pos _ -> [t "." <> t (childCallLab pos) <> parens (empty)]) + (\pos _ -> [t "." <> t (Lab.childCall pos) <> parens (empty)]) hunk ./src/Hburg/Gen/Java/Tile.hs 333 - Just term -> t (termToEnumLab $ nonTerminal term) + Just term -> t (Lab.termToEnum $ nonTerminal term) hunk ./src/Hburg/Gen/Java/Tile.hs 357 - then t (I.nId ids) <> hcat call <> t ".kind() ==" <+> t (termToEnumLab n) + then t (I.nId ids) <> hcat call <> t ".kind() ==" <+> t (Lab.termToEnum n) hunk ./src/Hburg/Gen/Java/Tile.hs 361 - Just term -> t (termToEnumLab $ nonTerminal term) + Just term -> t (Lab.termToEnum $ nonTerminal term) hunk ./src/Hburg/Gen/Java/Var.hs 11 -module Gen.Emit.Java.Var ( +module Hburg.Gen.Java.Var ( hunk ./src/Hburg/Gen/Java/Var.hs 21 -import Gen.Document (Document(..)) -import Gen.Emit.Java.Modifier (Modifier) +import Hburg.Gen.Doc (Document(..)) +import Hburg.Gen.Java.Modifier (Modifier) hunk ./src/Hburg/Gen/Label.hs 13 -module Gen.Emit.Label ( +module Hburg.Gen.Label ( hunk ./src/Hburg/Gen/Label.hs 17 - termToEnumLab, prodToEnumLab, - termToEvalLab, - childCallLab, + termToEnum, + prodToEnum, + termToEval, + childCall, hunk ./src/Hburg/Gen/Label.hs 24 -import Util (toUpper) +import Hburg.Util (toUpper) hunk ./src/Hburg/Gen/Label.hs 26 -import Ast.Term (TermClass(..)) -import Ast.Def (Definition) -import Ast.Prod (Production) +import Hburg.Ast.Term (TermClass(..)) +import Hburg.Ast.Def (Definition) +import Hburg.Ast.Prod (Production) hunk ./src/Hburg/Gen/Label.hs 38 -termToEnumLab :: TermClass a => a -> Label -termToEnumLab t | (isTerminal t) = toUpper . show $ getId t -termToEnumLab t = "NT_"++ (toUpper . show $ getId t) +termToEnum :: TermClass a => a -> Label +termToEnum t | (isTerminal t) = toUpper . show $ getId t +termToEnum t = "NT_"++ (toUpper . show $ getId t) hunk ./src/Hburg/Gen/Label.hs 43 -termToEvalLab :: TermClass a => a -> Label -termToEvalLab t | (isTerminal t) = +termToEval :: TermClass a => a -> Label +termToEval t | (isTerminal t) = hunk ./src/Hburg/Gen/Label.hs 46 -termToEvalLab t = "eval_"++ (show $ getId t) +termToEval t = "eval_"++ (show $ getId t) hunk ./src/Hburg/Gen/Label.hs 49 -prodToEnumLab :: Definition -> Production -> Suffix -> Label -prodToEnumLab def prod suffix = +prodToEnum :: Definition -> Production -> Suffix -> Label +prodToEnum def prod suffix = hunk ./src/Hburg/Gen/Label.hs 58 -childCallLab :: Show a => a -> String -childCallLab str = "child"++ (show str) +childCall :: Show a => a -> String +childCall str = "child"++ (show str) hunk ./src/Hburg/Parse/Lexer.x 12 -module Parser.Lexer ( +module Hburg.Parse.Lexer ( hunk ./src/Hburg/Parse/Lexer.x 21 -import Csa.Elem (ElemClass(..)) +import Hburg.Csa.Elem (ElemClass(..)) hunk ./src/Hburg/Parse/Msg.hs 11 -module Parser.Messages ( +module Hburg.Parse.Msg ( hunk ./src/Hburg/Parse/Msg.hs 21 -import Parser.Lexer(Token) -import Ast.Node(Node, showAsFun) +import Hburg.Parse.Lexer(Token) +import Hburg.Ast.Node(Node, showAsFun) hunk ./src/Hburg/Parse/Msg.hs 25 -import qualified Csa.Elem as E (ElemClass(..), Elem, new) +import qualified Hburg.Csa.Elem as E (ElemClass(..), Elem, new) hunk ./src/Hburg/Parse/Parser.y 11 -module Parser.Parser ( +module Hburg.Parse.Parser ( hunk ./src/Hburg/Parse/Parser.y 21 -import Util (toInt) +import Hburg.Util (toInt) hunk ./src/Hburg/Parse/Parser.y 23 -import Ast.Op (Operator, op, opMap) -import Ast.Term (Term, TermClass(..), terminal, nonTerminal) -import Ast.Ir (Ir(..), OperatorMap) +import Hburg.Ast.Op (Operator, op, opMap) +import Hburg.Ast.Term (Term, TermClass(..), terminal, nonTerminal) +import Hburg.Ast.Ir (Ir(..), OperatorMap) hunk ./src/Hburg/Parse/Parser.y 27 -import Parser.Lexer (Token(..), TokenClass(..)) -import Parser.Messages (parseErrDupBind, parseErrTok, parseErrRedef) +import Hburg.Parse.Lexer (Token(..), TokenClass(..)) +import Hburg.Parse.Msg (parseErrDupBind, parseErrTok, parseErrRedef) hunk ./src/Hburg/Parse/Parser.y 34 -import qualified Debug as Debug (Level(..), Entry, new) +import qualified Hburg.Debug as Debug (Level(..), Entry, new) hunk ./src/Hburg/Parse/Parser.y 36 -import qualified Ast.Incl as Incl (Include, new) -import qualified Ast.Ident as Id (toIdent) -import qualified Ast.Bind as B (new, empty, getIdent) -import qualified Ast.Attr as A (Attr, AttrTy(..), new, ty, emptyTy) -import qualified Ast.Code as C (Code, new, empty, isEmpty) -import qualified Ast.Decl as Decl (new) -import qualified Ast.Def as Def (Definition, new) -import qualified Ast.Nt as Nt (new) -import qualified Ast.T as T (new) -import qualified Ast.Node as N (Node, TreeClass(..), new, setLink, addLinkCode) -import qualified Ast.Prod as P (Production, new) -import qualified Ast.Cost as Cost (Cost, static, dynamic) +import qualified Hburg.Ast.Incl as Incl (Include, new) +import qualified Hburg.Ast.Ident as Id (toIdent) +import qualified Hburg.Ast.Bind as B (new, empty, getIdent) +import qualified Hburg.Ast.Attr as A (Attr, AttrTy(..), new, ty, emptyTy) +import qualified Hburg.Ast.Code as C (Code, new, empty, isEmpty) +import qualified Hburg.Ast.Decl as Decl (new) +import qualified Hburg.Ast.Def as Def (Definition, new) +import qualified Hburg.Ast.Nt as Nt (new) +import qualified Hburg.Ast.T as T (new) +import qualified Hburg.Ast.Node as N (Node, TreeClass(..), new, setLink, addLinkCode) +import qualified Hburg.Ast.Prod as P (Production, new) +import qualified Hburg.Ast.Cost as Cost (Cost, static, dynamic) hunk ./src/Hburg/Parse/Parser.y 49 -import qualified Csa.Csa as Csa (updateCtx, checkCtx, checkDef, checkProd) +import qualified Hburg.Csa.Csa as Csa (updateCtx, checkCtx, checkDef, checkProd) hunk ./src/Hburg/Parse/Parser.y 51 -import qualified Csa.Ctx as Ctx (Ctx, new, empty, merge) -import qualified Csa.Elem as Elem (new) +import qualified Hburg.Csa.Ctx as Ctx (Ctx, new, empty, merge) +import qualified Hburg.Csa.Elem as Elem (new) hunk ./src/Hburg/Util.hs 11 -module Util ( +module Hburg.Util ( hunk ./src/Hburg/Util.hs 24 -{- | stToInt. Convert a string to a number given a base. -} +{- | Convert a string to a number given a base -} hunk ./src/Hburg/Util.hs 42 -{- | toInt. Convert String to Int. -} +{- | Convert String to Int -} hunk ./src/Hburg/Util.hs 46 -{- | toUpper. Convert String to upper case String -} +{- | Convert String to upper case String -} hunk ./src/Main.hs 26 -import Parser.Lexer (scanner) -import Parser.Parser (ParseResult(..), parse) +import Hburg.Parse.Lexer (scanner) +import Hburg.Parse.Parser (ParseResult(..), parse) hunk ./src/Main.hs 30 -import qualified Debug as D (Level(..), Entry, new, filter, format) +import qualified Hburg.Debug as D (Level(..), Entry, new, filter, format) hunk ./src/Main.hs 32 -import qualified Ast.Ir as Ir (Ir(..)) +import qualified Hburg.Ast.Ir as Ir (Ir(..)) hunk ./src/Main.hs 34 -import qualified Gen.Backend as B (emit) -import qualified Gen.Emit as E (Emit(..)) +import qualified Hburg.Gen.Backend as B (emit) +import qualified Hburg.Gen.Emit as E (Emit(..)) hunk ./src/Main.hs 39 -{- | main. Read arguments and start code generator -} +{- | Read arguments and start code generator -} hunk ./src/Main.hs 87 + }