free-compiler-0.3.0.0: A Haskell to Coq compiler.

Safe HaskellSafe
LanguageHaskell2010

FreeC.IR.Syntax

Description

This module contains the abstract syntax tree (AST) for the intermediate representation (IR) of the compiler.

The intermediate language is very similar to the subset of Haskell supported by the compiler. The main goal is to make the transformations on the AST and code generation functions easier to comprehend. The IR does have fewer syntactic constructs than Haskell so that fewer cases need to be distinguished. For example, there is no explicit representation of infix function applications and no list literals. These kinds of syntactic sugar must be removed by the front end.

An additional goal of this AST is to reduce coupling with the parsing library and source language. Ideally, the compiler works with any language whose AST can be transformed into this intermediate representation.

A parser for the intermediate language and a description of its syntax can be found in FreeC.Frontend.IR.Parser. While the intermediate language can be parsed, IR nodes are usually created by parsing another language and converting their AST to the IR AST.

Documentation