Git Product home page Git Product logo

ico-caml's Introduction

Projet ICO :
Compilation & printing abstract tree of a pseudoPascal file .

testing :
execute in this order: 
ocamlyacc parser.mly
ocamlc -c parser.mli
ocamlc -c parser.ml
ocamllex lexer.mll
ocamlc -c lexer.mli
ocamlc -c main.ml

then make the project by typing : make

then you’re good to go : 
execute ./pseudopascal fact3.p (you can test any pseudo pascal file (.p) by entering its directory)

files?
lexer.mll : LEX file containing formal syntax of the pseudo pascal language
parser.mly : YACC file containing the grammar used to parse the buffer of syntax 
pp.mli : OCAML interface file defining different Pseudopascal abstract syntax structures (program,function, procedure …)
main.ml : we have the lexer and we have the parser, this file joins the 2 to make a fully functional syntax parser.

sources & docs : 
http://www.matt-mcdonnell.com/code/code_ocaml/lexing/lexing.html
http://plus.kaist.ac.kr/~shoh/ocaml/ocamllex-ocamlyacc/ocamllex-tutorial/ocamllex-tutorial.html
http://plus.kaist.ac.kr/~shoh/ocaml/ocamllex-ocamlyacc/ocamlyacc-tutorial/ 
http://www.cs.bilkent.edu.tr/~guvenir/courses/CS315/lex-yacc/linux.html
http://tldp.org/HOWTO/Lex-YACC-HOWTO-4.html
http://dinosaur.compilertools.net/yacc/index.html
http://cs.au.dk/~mis/dOvs/slides/37a-abstractsyntaxtrees.pdf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.