imp
所属分类:编译器/解释器
开发工具:Haskell
文件大小:37KB
下载次数:0
上传日期:2020-06-16 18:56:06
上 传 者:
sh-1993
说明: 在Haskell中实现的IMP编程语言编译器
(Compiler for IMP programming language implemented in Haskell)
文件列表:
.editorconfig (303, 2020-06-17)
.travis.yml (492, 2020-06-17)
LICENSE (1156, 2020-06-17)
Setup.hs (46, 2020-06-17)
imp.cabal (2414, 2020-06-17)
lib (0, 2020-06-17)
lib\IMP (0, 2020-06-17)
lib\IMP\AST.hs (2199, 2020-06-17)
lib\IMP\Codegen (0, 2020-06-17)
lib\IMP\Codegen\Error.hs (4088, 2020-06-17)
lib\IMP\Codegen\GlobalCodegen.hs (9147, 2020-06-17)
lib\IMP\Codegen\SubCodegen.hs (9741, 2020-06-17)
lib\IMP\Codegen\Utils.hs (4016, 2020-06-17)
lib\IMP\Emit.hs (15444, 2020-06-17)
lib\IMP\Parser.hs (8730, 2020-06-17)
lib\IMP\Parser (0, 2020-06-17)
lib\IMP\Parser\Error.hs (1127, 2020-06-17)
lib\IMP\SourceLoc.hs (1238, 2020-06-17)
lib\IMP\SymbolTable.hs (1429, 2020-06-17)
lib\IMP\Types.hs (811, 2020-06-17)
lib\Test (0, 2020-06-17)
lib\Test\Tasty (0, 2020-06-17)
lib\Test\Tasty\IMP.hs (4292, 2020-06-17)
package.yaml (1288, 2020-06-17)
src (0, 2020-06-17)
src\Main.hs (7192, 2020-06-17)
stack.yaml (85, 2020-06-17)
stdlib (0, 2020-06-17)
stdlib\impstd.c (1051, 2020-06-17)
stdlib\impstd.h (462, 2020-06-17)
test (0, 2020-06-17)
test\CompilerTests.hs (391, 2020-06-17)
test\IMP (0, 2020-06-17)
test\IMP\Test (0, 2020-06-17)
test\IMP\Test\Parser.hs (2749, 2020-06-17)
test\IMP\Test\Tests.hs (163, 2020-06-17)
test\TestSuite.hs (213, 2020-06-17)
... ...
IMP Compiler Implemented in Haskell
===================================
[![Build Status](https://travis-ci.org/eugmes/imp.svg?branch=master)](https://travis-ci.org/eugmes/imp)
This is an implementation of IMP compiler in Haskell programming
language. It uses [LLVM](http://llvm.org) as compiler backend.
[Megaparsec](https://hackage.haskell.org/package/megaparsec) is used
for parsing.
The programming language is specified in this document
.
This work is inspired by [Hakell LLVM Tutorial](http://www.stephendiehl.com/llvm/)
by Stephen Diehl.
Building
--------
It is recommended to use [stack](https://docs.haskellstack.org/en/stable/README/)
to build the program:
```
% stack build
```
After this IMP programs can be compiled by running:
```
% stack exec -- impc test/examples/hello.imp
% ./hello
Hello World!
```
This runs `cc`. To specify a different compiler, use `--cc` command line option
or `CC` environment variable.
Extensions
----------
The language has several extensions compared to the original specification.
All of the extensions are taken from [Ada](http://www.ada-auth.org/standards/12rm/html/RM-TOC.html):
- String literals can have embedded quotation marks by repeating them twice.
- If expressions can have additional `elsif` parts.
- Function and procedure arguments can have `in`, `out`, and `in out` modes.
近期下载者:
相关文件:
收藏者: