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

Latest commit

 

History

History
31 lines (17 loc) · 1022 Bytes

README.md

File metadata and controls

31 lines (17 loc) · 1022 Bytes

arnoldc-to-js

arnoldc-to-js is a compiler from ArnoldC language to Javascript.

You can read about the original project here : https://github.com/lhartikk/ArnoldC

How to use it

Just use the command node main PATH_TO_YOUR_FILE.arnoldc and it will output a javascript file next to the original file.

Then you can execute your generated file with NodeJS like a normal file.

How does it works ?

It uses Jison to parse the file and to produce a simple AST of the code.

Then, it uses functions defined in the file Transpiler.js to produce the corresponding Javascript code.

If you want to change the grammar rules in arnoldc.jison, don't forget to generate the parser afterwards !

First, you need to have Jison installed globally (by running the command npm install -g jison) and then to produce the parser : jison arnoldc.jison

Not supported yet

  • Non void methods
  • Return statement
  • Assign variable from method call
  • Read integer

It's coming soon !