uu-cco-0.1.0.5: Utilities for compiler construction: core functionality

Copyright(c) 2008 Utrecht University
LicenseAll rights reserved
Maintainerstefan@cs.uu.nl
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

CCO.Tree

Contents

Description

A straightforward implementation of the ATerm format for exchanging tree-structured data; see

  • Mark van den Brand, Hayco de Jong, Paul Klint, and Pieter A. Olivier. Efficient annotated terms. Software - Practice and Experience (SPE), 30(3):259-291, 2000.

Synopsis

The ATerm type

data ATerm Source

Terms.

Constructors

Integer Integer

Integer literal.

Float Double

Floating-point literal.

String String

Textual literal.

App Con [ATerm]

Constructor application.

Tuple [ATerm]

Tuple of terms.

List [ATerm]

List of terms.

Ann ATerm [ATerm]

Annotated term.

type Con = String Source

Node constructors.

The Tree class

class Tree a where Source

The Tree class. Instances provide conversions between tree-structured data and the ATerm format.

A minimal complete defintion must supply the methods fromTree and toTree.

Methods

fromTree Source

Arguments

:: a 
-> ATerm

Retrieves an ATerm from a Tree.

toTree Source

Arguments

:: ATerm 
-> Feedback a

Attempts to retrieve a Tree from an ATerm.

Parser