Skip to content

wenfahu/toy_c2js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A very simple compiler that compiles C- language defined in Compiler Design and Construction to javascript.

#Setup

This project depends on Jison (the javascript version of GNU Bison) which you can install via npm;

npm install -g jison

js-beautify is used to prettfy the code generated by Jison.

npm i

#Usage

Use Jison to generate the language parser defined in cc2js.jsion

jison cc2js.jsion

Use the parser to translate c file to js, for instance:

node cc2js.js tests/a.c

The translation result will be stored in a file named out.js.

About

a toy compiler from c language defined in CS455 (http://marvin.cs.uidaho.edu/Teaching/CS445/) to javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages