| Copyright | (c) Henry J. Wylde, 2015 |
|---|---|
| License | BSD3 |
| Maintainer | public@hjwylde.com |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Language.Qux.Annotated.Syntax
Description
Abstract syntax tree nodes with annotations. The annotation style was inspired by haskell-src-exts.
Instances of Simplifiable are provided for simplifying a node down to it's unannotated form and of
Pretty for pretty printing.
Type classes
class Annotated n where Source
An annotated class.
Annotations are used for attaching data to a node, such as a SourcePos.
class Simplifiable n r | n -> r where Source
A simplifiable class. Simplifiable is used to simplify a node to a a simpler form. See Language.Qux.Syntax for simpler forms of the nodes defined here.
Instances
| Simplifiable (Type a) Type Source | |
| Simplifiable (Expr a) Expr Source | |
| Simplifiable (Stmt a) Stmt Source | |
| Simplifiable (Decl a) Decl Source | |
| Simplifiable (Program a) Program Source | |
| Simplifiable (Id a) [Char] Source |
Annotated nodes
An identifier. Identifiers should match '[a-z_][a-zA-Z0-9_']*'.
A program is a module identifier (list of Id's) and a list of declarations.
A declaration.
A statement.
A complex expression.
Constructors
| ApplicationExpr a (Id a) [Expr a] | A function name to call and the arguments to pass as parameters. |
| BinaryExpr a BinaryOp (Expr a) (Expr a) | A binary operation. |
| ListExpr a [Expr a] | A list expression. |
| TypedExpr a Type (Expr a) | A typed expression. See Language.Qux.Annotated.TypeResolver. |
| UnaryExpr a UnaryOp (Expr a) | A unary operation. |
| ValueExpr a Value | A raw value. |
A type.
Regular nodes
A binary operator.
A unary operator.