Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoBugsNoLife compiler implementation #34

Open
wants to merge 94 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
fe4aab8
Add lexer, parser and ast
Vitico99 Apr 17, 2021
725744f
Add initial type checker implementation
amyGB99 Feb 9, 2022
040608c
Fix some errors in semantic checking and fix error messages
karlaoh99 Feb 10, 2022
24a05a6
Add docker environment for the project
Vitico99 Feb 12, 2022
36bf5c2
Fix errors messages
karlaoh99 Feb 20, 2022
3bd33f4
Fix errors in semantic
karlaoh99 Feb 21, 2022
ed14f85
Merge branch 'Type_Checker' of https://github.com/NoBugsNoLife/cool-c…
karlaoh99 Feb 21, 2022
ff911c7
Clean type inferencer logic
karlaoh99 Feb 21, 2022
4e30a3a
Update lexer to be used as the yacc lexer
Vitico99 Feb 22, 2022
8bc62c3
Add support for node location in the AST and the grammar
Vitico99 Feb 22, 2022
05ab2e5
Add location to semantic errors :)
Vitico99 Feb 22, 2022
abd09fb
Update the cool.py for the new lexer
Vitico99 Feb 22, 2022
2bc9dd8
Better docker setup for development
Vitico99 Feb 22, 2022
d4cb088
Merge pull request #1 from NoBugsNoLife/Type_Checker2
amyGB99 Feb 22, 2022
a290d97
Add Ast CIL and implement part of the building Ast CIL tour
amyGB99 Feb 23, 2022
2618bf4
Update CIL ast and update CIL tour
amyGB99 Feb 24, 2022
512ae30
Implement DispatchNode logic in CIL ast generator
karlaoh99 Feb 24, 2022
ec839df
Implement CaseNode, StringNode and InstantiateNode logic, in CIL ast…
karlaoh99 Feb 25, 2022
67da8c5
Implementation ConditionalNode in CIL Ast generator
amyGB99 Feb 25, 2022
2a31a7d
updtate BinaryNode in CIL AST generator
amyGB99 Feb 25, 2022
3b6eb02
fix errors in CIL ast generator
amyGB99 Feb 25, 2022
af795d1
Add CIL code generation for debug tasks
Vitico99 Feb 25, 2022
55ee1d9
Update Dockerfile
Vitico99 Feb 25, 2022
5c4b8be
Fix bug with strings in CIL code generator
Vitico99 Feb 25, 2022
376052c
Implement LoopNode logic in CIL ast generator and add builtin types
karlaoh99 Feb 25, 2022
861ced5
add implementation init method of class and inheriths logic
amyGB99 Feb 25, 2022
c4f6a91
Fix errors in init classes functions
amyGB99 Feb 25, 2022
1c6b5b5
Fix error in create_init_class and remove unused nodes of CIL ast
karlaoh99 Feb 25, 2022
7470a61
Fix bug with ARG instructions in CIL code generator
Vitico99 Feb 25, 2022
447d8fb
Add basic MIPS code generator
Vitico99 Feb 25, 2022
cb868f7
Fix some errores found
amyGB99 Feb 25, 2022
9ce420d
Fix error found
karlaoh99 Feb 25, 2022
799fa48
Merge branch 'Building_MIPS_Codegen' of https://github.com/NoBugsNoLi…
Vitico99 Feb 25, 2022
2ba73f8
Fix other errors
karlaoh99 Feb 25, 2022
cff9910
Fix bugs with CIL AST node properties
Vitico99 Feb 25, 2022
d1dfcde
Merge branch 'Building_MIPS_Codegen' of https://github.com/NoBugsNoLi…
Vitico99 Feb 25, 2022
6cf0809
fix errors
amyGB99 Feb 25, 2022
2ad3096
Add length built in function
Vitico99 Feb 25, 2022
32507c8
Fix bugs related to Class method linking
Vitico99 Feb 25, 2022
f67ec72
Merge branch 'Building_MIPS_Codegen' of https://github.com/NoBugsNoLi…
Vitico99 Feb 25, 2022
c544f9a
defined init method Object
amyGB99 Feb 25, 2022
81ac63a
defined init method IO
amyGB99 Feb 25, 2022
66429ae
Merge branch 'Building_MIPS_Codegen' of https://github.com/NoBugsNoLi…
Vitico99 Feb 25, 2022
31a217a
Change the position of init method to first
amyGB99 Feb 25, 2022
ef54da3
Merge branch 'Building_MIPS_Codegen' of https://github.com/NoBugsNoLi…
Vitico99 Feb 25, 2022
1b2aec0
Fix bad registers in code generation
Vitico99 Feb 26, 2022
e6cf5c9
Fixes in memory management in code generation
Vitico99 Feb 26, 2022
4d1aea6
Modifiy Makefile to use spim
Vitico99 Feb 26, 2022
b18d0ff
Update cool.py to output the CIL code file
Vitico99 Feb 26, 2022
e923689
fix is_void
amyGB99 Feb 27, 2022
c8ec22c
fix error
amyGB99 Feb 27, 2022
23ec5a8
fix
amyGB99 Feb 27, 2022
ab33980
fix error
amyGB99 Feb 27, 2022
6abd28f
Change init method name for no conflicts
karlaoh99 Feb 27, 2022
84265e6
Fix then and ifthen labels
karlaoh99 Feb 27, 2022
52cea68
fix prime and not
amyGB99 Feb 27, 2022
d1a6a64
Merge branch 'Building_MIPS_Codegen' of https://github.com/NoBugsNoLi…
amyGB99 Feb 27, 2022
20bdc17
Change False and True nodes in CIL visitor
karlaoh99 Feb 27, 2022
dc9bcd7
Fix arithmetic and comparison operations code generation
Vitico99 Feb 27, 2022
dedef97
Fixes in code generation
Vitico99 Feb 27, 2022
9f2186a
fix VariableNode in CIL ASt
amyGB99 Feb 27, 2022
524477f
Merge branch 'Building_MIPS_Codegen' of https://github.com/NoBugsNoLi…
amyGB99 Feb 27, 2022
1c5db00
Fix error in AssignNode visitor
karlaoh99 Feb 27, 2022
d78de4a
Merge branch 'Building_MIPS_Codegen' of https://github.com/NoBugsNoLi…
karlaoh99 Feb 27, 2022
1d106bb
Fix the label of the last case case
karlaoh99 Feb 27, 2022
363bde2
Init basic types in let and attributes definitions when the expressio…
karlaoh99 Feb 27, 2022
085a49f
Fix error with emtpy string declaration
Vitico99 Feb 28, 2022
47d5f12
Fix error in locals of init functions
karlaoh99 Feb 28, 2022
a0d7e91
fix error in Dispatch
amyGB99 Feb 28, 2022
cff2900
fix dispatch
amyGB99 Feb 28, 2022
7c1347a
Fix dispatch code generation
Vitico99 Feb 28, 2022
fe8ea40
first part of implementation of new case
amyGB99 Feb 28, 2022
c5a388b
unfinished second part of the case
amyGB99 Feb 28, 2022
2229ce9
fix error
amyGB99 Feb 28, 2022
1d31f02
Fix bugs with code generation for comparison operators and fix substr…
Vitico99 Feb 28, 2022
135547b
fix error in second part of new implementation of case
amyGB99 Mar 1, 2022
4f924da
Fixed Case expression code generation
Vitico99 Mar 1, 2022
34f60cd
Add basic report
Vitico99 Mar 2, 2022
97c5525
update report
amyGB99 Mar 2, 2022
29f963c
Cleaning working directory
Vitico99 Mar 2, 2022
cc88514
Add last changes to report and attach report.pdf and team.yml
karlaoh99 Mar 2, 2022
cc6ff2c
Merge pull request #2 from NoBugsNoLife/Building_MIPS_Codegen
karlaoh99 Mar 2, 2022
751a980
Add BoxNode to CILAst and use it when an assign in cool is made and a…
karlaoh99 Mar 10, 2022
1ca8423
Make Int and Bool value types
Vitico99 Mar 12, 2022
3a69b0b
Updating report with value types discussion
Vitico99 Mar 12, 2022
93ff535
change report
amyGB99 Mar 12, 2022
6d77758
Merge pull request #3 from NoBugsNoLife/unboxing_cil_logic
amyGB99 Mar 12, 2022
31d221f
Add case optimization with O(n) running time with n branches
Vitico99 Mar 12, 2022
5bf5316
Update report with case optimization
Vitico99 Mar 12, 2022
cc99b48
Update memory structure images in report
Vitico99 Mar 12, 2022
6411fdd
Add report in pdf format
karlaoh99 Mar 12, 2022
5abc8bc
Merge pull request #4 from NoBugsNoLife/efficient_case
karlaoh99 Mar 12, 2022
2eadbb8
Fix typos in the report
Vitico99 Mar 12, 2022
74479dc
Add report in pdf format
karlaoh99 Mar 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM docker.uclv.cu/python:latest

COPY ./requirements.txt ./requirements.txt

RUN pip3 install -r requirements.txt

RUN apt update

RUN apt install spim -y

RUN mkdir cool-compiler-2021

WORKDIR /cool-compiler-2021
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pytest:
docker-compose run compiler make test

compile:
docker-compose run compiler python3 cool.py program.cl
exec:
docker-compose run compiler bash -c "python3 cool.py program.cl && spim"

spim:
docker-compose run compiler spim

Binary file added doc/report.pdf
Binary file not shown.
Binary file added doc/report/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/report/inheritance_memory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/report/memory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
447 changes: 447 additions & 0 deletions doc/report/report.md

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions doc/team.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
members:
- name: Nombre Apellido1 Apellido2
github: github_id
group: CXXX
- name: Nombre Apellido1 Apellido2
github: github_id
group: CXXX
- name: Nombre Apellido1 Apellido2
github: github_id
group: CXXX
- name: Amanda González Borrell
github: amyGB99
group: C411
- name: Karla Olivera Hernández
github: karlaoh99
group: C411
- name: Victor Manuel Cardentey Fundora
github: Vitico99
group: C411
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3.7"
services:
compiler:
build: .
working_dir: /cool-compiler-2021/src
volumes:
- .//:/cool-compiler-2021

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pytest
pytest-ordering
ply
Loading