Code Monkey home page Code Monkey logo

compiler's Introduction

Minipascal compiler

Manuel Felipe Pineda - Carlos Alvaro Gonzales

A minipascal compiler for my compliers course on Universidad Tecnologica de Pereira.

this is a free software project, if you want copy/change/modify for academic purposes, feel free to do it (Remember to give credit and thanks to the creators).

if you want to check the code, you can run any of pascal codes in test dir

to run

python <phase>.py path_to_file.pas

where can be: mpaslexer , mpasparser , semantic

  • Lexer returns a list with all tokens of program
  • Parser generate a .png image which will contains the AST for your progam, this file will be create at "path_to_file.png"
  • Semantic checks your progam and advertises you about the problems

to compile

python mpascal.py path_to_file.pas

This section is incomplete

##enjoy!


https://github.com/pin3da/compiler

compiler's People

Contributors

caal-15 avatar pin3da avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

compiler's Issues

Recursive definitions.

fun foo(x:int)
fun bar(x:int)
y:int;
begin
y := foo(x)
end;
begin
write(x)
end

Until now this definition is wrong.

If then instruction.

fun foo(x:int):int
begin
if (x > 3) then return 3

    /* Error.  The if-statement returns an int.  However, if we
       make it here, the function returns nothing at all. */
end

Recursive definitions.

fun foo(x:int)
fun bar(x:int)
y:int;
begin
y := foo(x)
end;
begin
write(x)
end

This is not recognized correctly

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.