Home > rpal_compiler

rpal_compiler

Rpal_compiler is a project mainly written in C and JAVASCRIPT, it's free.

A compiler for rpal : for now use this version http://github.com/muddana/rpal_compiler/tree/133485fa99762b1a8288ae80e529a70b5330b68e

RPAL INTERPRETER:

  • To Compile:

    make

  • Usage: ./bin/p1 [-ast] [-st] [-r] filename

    -ast generates Abstract Syntax Tree -st generates Standardized Tree -r runs the code

  • Sample program: let Sum(A) = Psum (A,Order A ) where rec Psum (T,N) = N eq 0 -> 0 | Psum(T,N-1)+T N in Print ( Sum (1,2,3,4,5) )

  • Documentation:(documentation generated by doxygen is also present in the html/latex folders) Find the documentation in docs folder: lexical rules - lexer.pdf RPAL grammer - rpal.grammar.pdf Standardizing Rules for converting a AST to Standardized Tree(ST) - subtxfms.pdf Control Stack Environment Machine(CSE Machine) to run the standardized gamma expression extracted from standardized tree - csem.pdf Notes on recursion and handling them in CSE Machine - recursion_rules_in_rpal.pdf

    Also included in the docs folder is another intrepreter of RPAL. Install this version of rpal to test the code for all test cases. There is a perl script to test the output of this interpreter with my interpreter, so need this interpreter to test the current project. To test after installing the interpreter: make test

Testing the code: The test files are in the tests folder. The tests folder contains 'Rpal' folder which has an rpal implementation by Steven V. Walstra. This code will be tested against rpal. After building that rpal, add it to your system path. Once this is done. to test

make test

TODO:

  • Fix the issue with "tiny" program from tests
  • clean up code.
  • improve code docs
  • add error predictor and locator ? Needs improvement to the lexer
Previous:JS-Klotski