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
Portabilitynon-portable (uses CPP)
Safe HaskellSafe
LanguageHaskell98

CCO.Component

Contents

Description

An arrow for constructing and composing compiler components.

Synopsis

Components

data Component a b Source

The Component arrow. A Component a b takes input of type a to output of type b.

Creating components

component :: (a -> Feedback b) -> Component a b Source

Creates a Component from a Feedback computation.

parser :: Lexer s -> Parser s a -> Component String a Source

Creates a Component from a Lexer and a Parser.

Generic components

Wrapping components

ioWrap :: Component String String -> IO () Source

Wraps a Component into a program that provides it with input from the standard input channel and relays its output to the standard output channel.

ioRun :: Component a b -> a -> IO b Source

Run a Component in the IO monad.