Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

meyer1994/ce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CE

A very simple C-like language.

How-to

Requirements

Venv (optional)

I recommend using python venv:

$ python -m venv venv && source ./venv/bin/activate

Dependencies

The dependencies are defined in requirements.txt. They are:

  • llvmlite, for code generation and some compilation;
  • ply, for lexing and parsing hte language;
  • flake8, for linting;
  • coverage, for code test coverage (not used much).
(venv) $ pip install -r requirements.txt

Execute

Place the code inside example.ce and execute:

(venv) $ make compile

It will generate an a.out with gcc. Or, if you prefer, you can execute:

(venv) $ python main.py -f example.ce > out.ir
(venv) $ lli out.ir

It will output the intermediary code into the file and run it with the llvm interpreter.