copilot-3.2.1: A stream DSL for writing embedded C programs.

Language.Copilot.Main

Description

Create Copilot executables that generate code or interpret streams and print the results to stdout.

Synopsis

# Documentation

copilotMain :: Interpreter -> Printer -> Compiler -> Spec -> IO () Source #

Create a main to either compile or interpret a copilot specification.

This function must be provided an auxiliary function capable of compiling Copilot Core specifications for some target.

The command line program supports four main commands:

• --output/-o: use the given compiler to produce C code.
• --justrun/-c: execute a dry-run, which parses and converts the specification to core but does not produce any output.
• --print/-p: pretty print the specification.
• --interpret/-i NUM: interpret the specification for a given number of steps.

defaultMain :: Compiler -> Spec -> IO () Source #

Create a main function with a default interpreter and pretty printer.

This function must be provided an auxiliary function capable of compiling Copilot Core specifications for some target.

This function relies on copilotMain, please refer to that function for the command line options.