CSPM-Interpreter-0.5.1.0: An interpreter for CSPM

PortabilityGHC-only
Stabilityexperimental
MaintainerFontaine@cs.uni-duesseldorf.de

CSPM.Interpreter.Test.CLI

Description

This is mainly useful for testing the functional sub language. This module does not allow tracing of processes (tracing is implemented in an other package).

runFile loads a CSPM-specification from a file and evaluates an expression in the context of that specification.

Example:

runFile fib.csp fib(10)

where the file fib.csp contains: fib(x)= if x <2 then 1 else fib(x-1)+fib(x-2)

runFile writes to stdout and handles some exceptions.

Synopsis

Documentation

runFileSource

Arguments

:: FilePath

a file containing a CSPM specification

-> String

a CSPM expression

-> IO () 

Load a specification from a file and evaluate an expression in the context. Print the result to stdout and handle some exceptions.

evalFileSource

Arguments

:: Bool

verbose output ?

-> Maybe FilePath

optional specification to load into context

-> String

a CSPM expression

-> IO (Value, Env) 

Evaluate an expression, optionall load a context from a file

evalStringSource

Arguments

:: Bool

verbose output ?

-> String

String containg CSPM specification (may be empty)

-> String

name of the specification for error-reporting

-> String

a CSPM expression

-> IO (Value, Env) 

Evaluate an expression, optionall load a context from a string