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

First pull request. #19

Open
wants to merge 218 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
d4975c2
First commit
matcom-chacha Oct 14, 2020
f00e045
Added notes.txt
matcom-chacha Oct 14, 2020
b794111
Merge pull request #1 from matcom-chacha/Gaby
matcom-chacha Oct 14, 2020
e314314
Added gitignore file
matcom-chacha Oct 23, 2020
597d6dd
Removed unnecessary folder __pychache__
matcom-chacha Oct 23, 2020
c54aaba
Merge pull request #2 from matcom-chacha/Gaby
matcom-chacha Oct 23, 2020
2bec81f
Check Semantics
Nov 26, 2020
bf6c141
Refactor
Nov 26, 2020
d71eb17
TSet builder
Nov 26, 2020
68a5a23
Tset reducer in some nodes.
Nov 28, 2020
3ab4f4d
Add .vscode to gitignore
matcom-chacha Nov 28, 2020
bd2499d
Complete pipeline. Infer as expected.
Nov 30, 2020
14ded78
Merge branch 'dev' of https://github.com/matcom-chacha/comp_type_infe…
Nov 30, 2020
3cd06de
Tokenizer rules specified for ply lexer
matcom-chacha Nov 30, 2020
ef23596
Merge branch 'dev' of https://github.com/matcom-chacha/comp_type_infe…
matcom-chacha Nov 30, 2020
6c7e2ca
Merge Tokenizer
matcom-chacha Nov 30, 2020
5c5ca0d
Add visual and tokenizer
Nov 30, 2020
21a6969
Add self type checking
Nov 30, 2020
29b3bfb
Add IO. Fix Case bug
Dec 7, 2020
7962d57
Print clean AST. Add self variable in every tset.
Dec 8, 2020
7575f21
Reduce param set using argument set and viceversa.
Dec 10, 2020
61741fc
Modify cool_visitor
matcom-chacha Dec 13, 2020
115e181
Fixe Cyclic Herit bug
matcom-chacha Dec 14, 2020
c51f8d4
Add String and Object methods
matcom-chacha Dec 14, 2020
9161d53
Add test description.
Dec 14, 2020
7698225
Test Self
matcom-chacha Dec 14, 2020
23c814e
Cyclic Heritage Bug Fixed
matcom-chacha Dec 14, 2020
338e220
Merge branch 'dev'
matcom-chacha Dec 15, 2020
5b49be5
Change names
matcom-chacha Dec 15, 2020
f57e993
Add .directory and informe.pdf
Apr 13, 2021
c250550
merged and resolved conflict in gitignore
matcom-chacha Jul 17, 2021
4627e06
Merged old code with base Cool Cmp 2021
matcom-chacha Jul 17, 2021
63a668d
Add report README CMP PRACT LAB
matcom-chacha Jul 17, 2021
2f16377
feat: add grammar, tokenizer and ast nodes
amaliaibarra Feb 9, 2022
827c82e
feat: add main and cmp
amaliaibarra Feb 11, 2022
096a20e
feat: add context to ast. Type collector returns new ast
amaliaibarra Feb 12, 2022
206b6d3
feat: type_builder returns new ast with context
amaliaibarra Feb 13, 2022
ed72f8f
feat: add pipeline and error classes. Remove src module
amaliaibarra Feb 16, 2022
0656b2c
feat: lexer and parser collect errors, don't throw exception
amaliaibarra Feb 18, 2022
844deea
feat!: update with amaliaibarra repo
amaliaibarra Feb 19, 2022
9650404
Merge pull request #1 from amaliaibarra/dev
amaliaibarra Feb 19, 2022
fa0b9dd
Fix line
matcom-chacha Feb 22, 2022
8637267
Fix part of column number.
matcom-chacha Feb 22, 2022
cee4adc
feat: add cil hierarchy and cil visitor
amaliaibarra Feb 22, 2022
24293d3
Fix columns.
matcom-chacha Feb 22, 2022
11a67c4
Ignore { } characters in comments.
matcom-chacha Feb 22, 2022
4a5f65b
Correct detection of null character in strings.
matcom-chacha Feb 22, 2022
7befb2a
Fix string analisis in lexer.
matcom-chacha Feb 23, 2022
cf36521
Fix coolc.sh to run test correctly.
matcom-chacha Feb 23, 2022
7d333b9
Remove unnecesary comments.
matcom-chacha Feb 23, 2022
ccb8687
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
matcom-chacha Feb 23, 2022
2a8914f
Change errors messages.
matcom-chacha Feb 23, 2022
f05dfa9
feat: use provided cil hierarchy.
amaliaibarra Feb 23, 2022
533b7b0
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
amaliaibarra Feb 23, 2022
78f5cd3
Modify lexer to detect dif types of ids.
matcom-chacha Feb 23, 2022
47ed5cc
feat: add entry function. Reset visitor state after visit
amaliaibarra Feb 23, 2022
250a4b7
Report token's row and column in parser.
matcom-chacha Feb 23, 2022
27ade0e
fix: fix compile and runtime errors to run hello_world test
amaliaibarra Feb 24, 2022
83ee343
Initial cil to mips code, still not working
smartos99 Feb 24, 2022
cbb52a6
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
smartos99 Feb 24, 2022
9be0a4d
Consider case insentive keywords.
matcom-chacha Feb 24, 2022
ec1f5ae
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
matcom-chacha Feb 24, 2022
b6e67a0
Fix error token if multiply defined.
matcom-chacha Feb 24, 2022
05f4aac
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
smartos99 Feb 24, 2022
b3f6c3c
Remove unnecessary prints.
matcom-chacha Feb 24, 2022
4da9d41
Change "new x"'s lvl in cool grammar.
matcom-chacha Feb 24, 2022
a180fa3
Change "not" level in grammar.
matcom-chacha Feb 24, 2022
8a689d3
Modify grammar to detect missing parameters.
matcom-chacha Feb 24, 2022
3bf6a5f
Change lvl of if-t-else, while and case exps.
matcom-chacha Feb 24, 2022
bf99b5e
Correct indexes of EOF token.
matcom-chacha Feb 24, 2022
510a664
Some visitorsadded
smartos99 Feb 24, 2022
91c7f1c
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
smartos99 Feb 24, 2022
a0b3487
feat: add builtin functions
amaliaibarra Feb 25, 2022
50ba3b6
feat: add type constructors
amaliaibarra Feb 25, 2022
46350e2
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
amaliaibarra Feb 25, 2022
cbba862
Visitors Added
smartos99 Feb 25, 2022
ba199c3
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
smartos99 Feb 25, 2022
b3fbd6b
Conflicts fixed in cil.py
smartos99 Feb 25, 2022
004f02a
Fix small error in type_checker.
matcom-chacha Feb 25, 2022
3f96938
Modify flow to pass tokens with location info.
matcom-chacha Feb 25, 2022
41a0221
Correct calls to ast's properties.
matcom-chacha Feb 25, 2022
a47cd56
feat: add default value to attrs. Visited nodes return vars.
amaliaibarra Feb 26, 2022
8758b4f
fix: TypeNode constructor only receives name param
amaliaibarra Feb 26, 2022
6321ec4
Pass token to parser with actual column.
matcom-chacha Feb 26, 2022
c387b60
feat: add missing nodes to PrintVisitor
amaliaibarra Feb 26, 2022
2ddb02a
add simple functions funcionalities
smartos99 Mar 1, 2022
9ddaf65
feat: add return value to If, While and Boolean Nodes
amaliaibarra Mar 1, 2022
0b94a22
Merge branch 'amalia/feat/coolToCIL' into dev
amaliaibarra Mar 1, 2022
f751039
Merge dev into mips
smartos99 Mar 2, 2022
5637a37
Fix "not" precedence.
matcom-chacha Mar 2, 2022
8e12a89
fix: remove entry function
amaliaibarra Mar 2, 2022
291b9a1
fix: change InitNode to call type constructor
amaliaibarra Mar 3, 2022
8907a83
Merge branch 'amalia/feat/coolToCIL' into dev
amaliaibarra Mar 3, 2022
07178eb
Fix details in type checker.
matcom-chacha Mar 4, 2022
fa34d13
Continue with type checker testing.
matcom-chacha Mar 4, 2022
ed7e678
Accept changes from dev
smartos99 Mar 4, 2022
032e1ca
Merge branch 'dev' into mips
smartos99 Mar 4, 2022
54d88b6
feat: allocate returns self
amaliaibarra Mar 5, 2022
3241c9f
Merge branch 'amalia/feat/coolToCIL' into dev
amaliaibarra Mar 5, 2022
dba699a
Fix tokenizer error of taking strings as keywords.
matcom-chacha Mar 5, 2022
dce1985
feat: use cil nodes in build_constructor
amaliaibarra Mar 5, 2022
33c4ca5
feat: add instance prop to nodes that use self
amaliaibarra Mar 5, 2022
86d5b22
Identify attributes inherited from other classes.
matcom-chacha Mar 5, 2022
d6d0320
Correct get_type method in type_builder.
matcom-chacha Mar 5, 2022
982d67e
feat: add get attr to variable node
amaliaibarra Mar 5, 2022
13b3e4c
Merge branch 'amalia/feat/coolToCIL' into dev
amaliaibarra Mar 5, 2022
753bc42
Add PrintNodes
smartos99 Mar 5, 2022
4fecd4e
fix: check param names in is_attribute function
amaliaibarra Mar 5, 2022
82ba3d8
Merge branch 'amalia/feat/coolToCIL' into dev
amaliaibarra Mar 5, 2022
d23e09a
Merge branch 'mips' into dev
smartos99 Mar 5, 2022
97db5a3
Stage to push
smartos99 Mar 5, 2022
f185173
Add PrintStr and PrintInt to PrintVisitor
smartos99 Mar 5, 2022
6088e45
fix: get instance from constructor
amaliaibarra Mar 5, 2022
29f7781
Fix PrintIntNode
smartos99 Mar 5, 2022
2655eab
Merge branch 'mips' into dev
smartos99 Mar 5, 2022
8a8c610
feat: add builtin constructors
amaliaibarra Mar 5, 2022
23c5775
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
amaliaibarra Mar 5, 2022
d24d695
feat: add data to LoadNode
amaliaibarra Mar 5, 2022
69b36a9
Merge branch 'amalia/feat/coolToCIL' into dev
amaliaibarra Mar 5, 2022
f5102e2
Fix Order of SetAttr args in cil_builder
smartos99 Mar 5, 2022
ef252d2
Merge branch 'mips' into dev
smartos99 Mar 5, 2022
3c8fd06
Correct inheritance cycle detection.
matcom-chacha Mar 6, 2022
e8c6723
Add TypeOfNode
smartos99 Mar 6, 2022
5eb9851
feat: add dynamic and static call functions
amaliaibarra Mar 6, 2022
2f49228
Merge branch 'amalia/feat/coolToCIL' into dev
amaliaibarra Mar 6, 2022
42b0f94
Add static labels
smartos99 Mar 6, 2022
c6c2d92
Merge branch 'mips' into dev
smartos99 Mar 6, 2022
28e9ffc
Add elements to method redef and self analisis.
matcom-chacha Mar 6, 2022
c88aa2c
fix: add missing parameter to Load in StringNode
amaliaibarra Mar 6, 2022
f2c1347
fix!: add return_var to visitor
amaliaibarra Mar 6, 2022
5c6be8f
fix: comment mips visitor in main
amaliaibarra Mar 6, 2022
e68cb48
Remove unnecessary code. Fix erros.
matcom-chacha Mar 6, 2022
889bdfb
Change stack order
smartos99 Mar 6, 2022
f1fc043
Merge branch 'mips' into dev
smartos99 Mar 6, 2022
6847e9a
Correct details in error reporting mecanism.
matcom-chacha Mar 6, 2022
e647667
ref: clean unnecessary props from visitor
amaliaibarra Mar 6, 2022
908a1c6
Merge branch 'dev' into amalia/feat/coolToCIL
amaliaibarra Mar 6, 2022
7a51403
Fix mips_writer
smartos99 Mar 6, 2022
8de7e79
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
smartos99 Mar 6, 2022
e93b54b
Merge branch 'mips' into dev
smartos99 Mar 6, 2022
83d0630
Complete sematic checking.
matcom-chacha Mar 7, 2022
085fa5a
fix: remove self.self_var. Add methods & attrs dicts
amaliaibarra Mar 7, 2022
455bbf4
Modify type checker to add types.
matcom-chacha Mar 7, 2022
654ec33
fix: send args all at once
amaliaibarra Mar 7, 2022
d22332c
Check for None params while building typed ast.
matcom-chacha Mar 7, 2022
b482803
Reorganize params while building typed ast.
matcom-chacha Mar 7, 2022
8c317cb
Hello world works with Static call
smartos99 Mar 7, 2022
c17696a
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
smartos99 Mar 7, 2022
51e6f46
Merge branch 'mips' into dev
smartos99 Mar 7, 2022
f35fe70
Merge branch 'check_semantics' into dev
matcom-chacha Mar 7, 2022
4cdc30d
Remove unnecessary import.
matcom-chacha Mar 7, 2022
f4805fd
fix: import ast_type_nodes
amaliaibarra Mar 7, 2022
7b73f65
Merge branch 'dev' into amalia/feat/coolToCIL
amaliaibarra Mar 7, 2022
c26c851
feat: add dynamic call
amaliaibarra Mar 7, 2022
99fd3ab
Fix AssignNode visitor
smartos99 Mar 7, 2022
d04249d
Merge branch 'mips' into dev
smartos99 Mar 7, 2022
74dfe83
Hello world works with dynamic call
smartos99 Mar 7, 2022
6c262ed
Dynamic Call works
smartos99 Mar 8, 2022
01387e3
ref: remove unnecessary nodes from cil
amaliaibarra Mar 8, 2022
84a95c7
ReadString works
smartos99 Mar 8, 2022
c6c84a6
Testing mips
smartos99 Mar 8, 2022
b2d7d8f
Merge branch 'dev' into amalia/feat/coolToCIL
amaliaibarra Mar 8, 2022
8b13c65
fix: create Bool cosntant in NotNode
amaliaibarra Mar 8, 2022
800f859
while and comparisons work
smartos99 Mar 8, 2022
367f3f4
Merge branch 'mips' into dev
smartos99 Mar 8, 2022
e1b8628
String Methods work
smartos99 Mar 9, 2022
f38a82f
Add tests
smartos99 Mar 9, 2022
438a093
feat: override type_name and copy methods
amaliaibarra Mar 9, 2022
688f9f4
feat: update tests
amaliaibarra Mar 9, 2022
6aea015
fix: discard changes in string_methods test
amaliaibarra Mar 9, 2022
3a89482
Merge branch 'amalia/feat/coolToCIL' into dev
amaliaibarra Mar 9, 2022
44707b0
Add IsVoidNode
smartos99 Mar 9, 2022
586d520
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
smartos99 Mar 9, 2022
e0772ed
Merge branch 'mips' into dev
smartos99 Mar 9, 2022
ffffba0
Fix Conflicts
smartos99 Mar 9, 2022
f0138b5
feat: add isvoid test
smartos99 Mar 9, 2022
028d8a5
First Readme scratch.
matcom-chacha Mar 9, 2022
c910526
Merge before testing
smartos99 Mar 9, 2022
e83baf8
Merge branch 'mips' into dev
smartos99 Mar 9, 2022
bd892e8
Update report.
matcom-chacha Mar 9, 2022
a145c62
Merge branch 'report' into dev
matcom-chacha Mar 9, 2022
d87a2fb
Add grammar pic to report.
matcom-chacha Mar 9, 2022
34dad27
Edit report's images description.
matcom-chacha Mar 9, 2022
2582ff6
Add StrEqual
smartos99 Mar 9, 2022
29a1f15
Merge branch 'mips' into dev
smartos99 Mar 9, 2022
6f51f01
feat: add case and let scope.
amaliaibarra Mar 9, 2022
290329c
Merge branch 'amalia/feat/coolToCIL' into dev
amaliaibarra Mar 9, 2022
f3ab478
Fix read string
smartos99 Mar 9, 2022
c31e5b1
fix: add self to variableNode
amaliaibarra Mar 10, 2022
579162c
Merge branch 'amalia/feat/coolToCIL' into dev
amaliaibarra Mar 10, 2022
3d7ac7a
Merge branch 'mips' into dev
smartos99 Mar 10, 2022
a44ef2d
Remove read string test
smartos99 Mar 10, 2022
6b3e5c0
Modify Default Node
smartos99 Mar 10, 2022
055ba45
Change TypeOfNode
smartos99 Mar 10, 2022
20b8666
feat: use dynamic type in case
amaliaibarra Mar 10, 2022
d12a9b5
Merge branch 'dev' into amalia/feat/coolToCIL
amaliaibarra Mar 10, 2022
c992c26
feat: add CompareTypes node. Passed 4 more tests
amaliaibarra Mar 10, 2022
bd57822
Fix comment state bug.
matcom-chacha Mar 10, 2022
0f55360
Merge branch 'fix_lexer' into dev
matcom-chacha Mar 10, 2022
6d2b283
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
matcom-chacha Mar 10, 2022
a3031ab
Redefine abort method
smartos99 Mar 10, 2022
df3acb9
Merge branch 'sandra/mips' into dev
smartos99 Mar 10, 2022
9e29197
feat: add attribute constructors
amaliaibarra Mar 10, 2022
808735f
Merge branch 'amalia/feat/LetIn' into dev
amaliaibarra Mar 10, 2022
2056412
fix: inherited redefined methods
amaliaibarra Mar 10, 2022
a4f93dc
Add grammar pic to report.
matcom-chacha Mar 11, 2022
07f61cb
codegen tests passed
smartos99 Mar 11, 2022
98a3fc0
delete unnecesary imports
smartos99 Mar 11, 2022
22d8a26
remove unnecesary files
smartos99 Mar 11, 2022
f4da28a
Merge branch 'final_details' into dev
matcom-chacha Mar 11, 2022
2780b9c
Add self type checking in Case Node.
matcom-chacha Mar 11, 2022
bed772a
Ensure "comp" expr does not associate.
matcom-chacha Mar 11, 2022
bf476ca
feat: add cool to cil section to report
amaliaibarra Mar 11, 2022
10089cc
Merge branch 'dev' of https://github.com/peanut-butter-jellyyy/cool-c…
amaliaibarra Mar 11, 2022
a292731
Restructure folders and scripts.
matcom-chacha Mar 11, 2022
27d3919
Merge branch 'format_code' into dev
matcom-chacha Mar 11, 2022
f81c148
Remove extra comments
matcom-chacha Mar 11, 2022
1855d7f
Finish report.
matcom-chacha Mar 11, 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
4 changes: 4 additions & 0 deletions .directory
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Dolphin]
Timestamp=2022,2,19,10,32,56
Version=4
ViewMode=1
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig

# Created by https://www.gitignore.io/api/visualstudiocode,linux,latex,python
Expand Down Expand Up @@ -291,6 +292,11 @@ TSWLatexianTemp*
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
src/__pycache__/
test/__pycache__/
src/cmp/__pycache__/
src/cmp/tools/__pycache__/
.directory/
*.py[cod]
*$py.class

Expand Down Expand Up @@ -407,4 +413,3 @@ dmypy.json
# End of https://www.gitignore.io/api/visualstudiocode,linux,latex,python

# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

149 changes: 5 additions & 144 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# COOL: Proyecto de Compilación

> Proyecto base para el compilador de 4to año en Ciencia de la Computación.
> Forked from: https://github.com/matcom/cool-compiler-2021, proyecto base para el compilador de 4to año en Ciencia de la Computación.

## Generalidades

Expand All @@ -10,158 +10,19 @@ funcional para el lenguaje _COOL_.

_COOL (Classroom Object-Oriented Language)_ es un pequeño lenguaje que puede ser implementado con un esfuerzo razonable en un semestre del curso. Aun así, _COOL_ mantiene muchas de las características de los lenguajes de programación modernos, incluyendo orientación a objetos, tipado estático y manejo automático de memoria.

## Cómo comenzar (o terminar)

El proyecto de Compilación será recogido y evaluado **únicamente** a través de Github. Es imprescindible tener una cuenta de Github para cada participante, y que su proyecto esté correctamente hosteado en esta plataforma. A continuación le damos las instrucciones mínimas necesarias para ello:

### 1. Si no lo han hecho ya, regístrense en [Github](https://github.com) todos los miembros del equipo (es gratis).

![](img/img1.png)

### 2. Haga click en el botón **Fork** para hacer una copia del proyecto en el perfil de Github de uno de los miembros.

Opcionalmente pueden [crear una organización](https://github.com/organizations/new) y copiar el proyecto en el perfil de la misma.

![](img/img2.png)

### 3. Una vez hecho esto, tendrá un nuevo repositorio en `github/<usuario>`.

Revise que el repositorio de su equipo está en su perfil.
En este ejemplo se ha copiado a la cuenta de `github.com/apiad`.

Debe indicar bajo el nombre del repositorio: `"forked from matcom/cool-compiler-2021"`.

![](img/img3.png)

### 4. Clone este proyecto en un repositorio local.

Busque la URL de su proyecto en la interfaz web de Github.

Asegúrese de clonar **su copia** y no el proyecto original en `matcom/cool-compiler-2021`.

![](img/img4.png)

```bash
$ git clone [email protected]:<usuario>/cool-compiler-2021.git
```

> Donde `<usuario>` es posiblemente el nombre de su equipo o del miembro donde se hizo el _fork_.

A partir de este punto debe tener un proyecto `cool-compiler-2021` local.
El siguiente paso depende de si usted ya tiene su código versionado con `git` o no.

### 5.A. Si tiene su proyecto en git (y no quiere perder la historia):

#### 5.1. Mezcle hacia el nuevo respositorio su repositorio anterior:

```bash
$ cd cool-compiler-2021
$ git pull --allow-unrelated-histories <my-old-compiler-project> master
```

#### 5.2. Organice su proyecto, código fuente y documentación, de acuerdo a las instrucciones de este documento, y vuelva a hacer `commit`.

```bash
$ mv <my-old-code> src/
$ git add .
$ git commit -a -m "Mezclado con el proyecto base"
```

#### 5.3. A partir de este punto puede hacer `push` cada vez que tenga cambios que subir.

```bash
$ git push origin master
```

### 5.B Si aún no tiene su proyecto en git (o no le importa la historia):

#### 5.1. Simplemente copie el código de su proyecto en la carpeta correspondiente `src` y haga su primer commit.

```bash
$ mv <my-old-code> src/
$ git commit -a -m "Hello Git!"
```

#### 5.2. A partir de este punto asegúrese de hacer `commit` de forma regular para mantener su repositorio actualizado.

Si necesita saber más sobre `git`, todo lo imprescindible está en [esta guía](doc/github-git-cheat-sheet.pdf).

#### 5.3. A partir de este punto puede hacer `push` cada vez que tenga cambios que subir.

```bash
$ git push origin master
```

## Entregas

En este proyecto se realizarán entregas parciales a lo largo del curso. Para realizar una entrega, siga los siguientes pasos.

### 1. Cree un pull request al proyecto original desde su copia.

![](img/img5.png)

### 2. Asegúrese de tener la siguiente configuración antes de hacer click en **Create pull request**.

- **base repository**: `matcom/cool-compiler-2021` (repositorio original)
- **branch**: `master`
- **head repository**: `<usuario>/cool-compiler-2021` (repositorio propio)
- **branch**: `master` (o la que corresponda)

> Asegúrese que se indica **Able to merge**. De lo contrario, existen cambios en el repositorio original que usted no tiene, y debe actualizarlos.

> **NOTA**: Asegúrese que el _pull request_ se hace a la rama `master`.

![](img/img6.png)

### 3. Introduzca un título y descripción adecuados, y haga click en **Create pull request**.

![](img/img7.png)

### 4. Espere mientras se ejecutan las pruebas.

Verá la indicación **Some checks haven't completed yet**.

![](img/img8.png)

Es posible que tenga que actualizar los cambios que se hayan hecho en el repositorio original, por ejemplo, si se han agregado nuevos tests. En este caso obtendrá el siguiente mensaje:

> **This branch is out-of-date with base branch**

Haga click en **Update branch** y siga las instrucciones.
### 5. Verifique que no hubo errores en las pruebas.

Si ve el mensaje **(All | Some) checks have failed**, significa que su código no pasó las pruebas.

![](img/img9.png)

Para ver los resultados de las pruebas haga click en el link **Details**.

![](img/img10.png)


### 6. Arregle los errores y repita el paso 5 hasta que todas las pruebas pasen.

Para cualquier modificación que haga a su proyecto, haga _commit_ y _push_ para **su repositorio personal** y automáticamente se actualizará el estado del _pull request_ y se volverán a ejecutar las pruebas. **No es necesario** abrir un _pull request_ nuevo por cada entrega, sino actualizar el anterior.

> **Por favor asegúrese de mantener un solo _pull request_ activo por equipo**. En caso de abrir uno nuevo, cerrar el anterior.

## Sobre la implementación

Ponga todo su código e instrucciones necesarias en la carpeta `src`. Más información en [`src/Readme.md`](src/Readme.md).
Todo el código e instrucciones necesarias se encuentran en la carpeta `src`. Más información en [`src/Readme.md`](src/Readme.md).

## Sobre la documentación

Usted debe presentar un reporte escrito documentando el proceso de construcción de su compilador y los detalles más importantes de su funcionamiento. Más información en [`doc/Readme.md`](doc/Readme.md).

## Sobre los equipos de desarrollo

Para desarrollar el compilador del lenguaje COOL se trabajará en equipos de 2 o 3 integrantes.
Se presenta un reporte escrito documentando el proceso de construcción del compilador y los detalles más importantes de su funcionamiento. Más información en [`doc/Readme.md`](doc/Readme.md).

## Sobre los casos de prueba

La carpeta `tests` contiene todos los casos de prueba que son obligatorios de pasar para que su proyecto tenga derecho a ser evaluado.
La carpeta `tests` contiene casos de prueba.

Estos tests se ejecutan automáticamente cada vez que hace un _pull request_ al repositorio `matcom/cool-compiler-2021`. Solo aquellos proyectos que pasen todas las pruebas con éxito serán evaluados.
Estos tests se ejecutan automáticamente cada vez que hace un _pull request_ al repositorio `matcom/cool-compiler-2021`.

Para ejecutar las pruebas localmente, debe tener instalado `Python 3.7`, `pip` y `make` (normalmente viene con Linux). Ejecute:

Expand Down
9 changes: 9 additions & 0 deletions customized_tests/lexer/no_strings.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"
class Cons {
xcar : Int ;
xcdr : String ;

isNill ( ) : Bool {
false
} ;
}
113 changes: 113 additions & 0 deletions customized_tests/lexer/reserve_words.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
(* Integers, Identifiers, and Special Notation *)

0007 123 +1 -1 +90 -09 +11113 -4r *a *self* c++
5! = 120, 2 + 2 = 5 or E = mc2; p + 1 @ p = 1: for x in range(len(b))
new / <- <<==> {( Int: Objet, Bool; String.string SELF_TYPE isvoid })
class Class if then else fi testing Testing ~007agent_bond james_007B0N3SS___
loop pool while tRuE or noT faLsE let in case of ESAC

(*
#3 case 0007
#3 inherits 123
#3 '+'
#3 ; 1
#3 '-'
#3 , 1
#3 '+'
#3 . 90
#3 '-'
#3 ( ) 09
#3 '+'
#3 { } 11113
#3 '-'
#3 @ 4
#3 + r
#3 '*'
#3 - a
#3 '*'
#3 * self
#3 '*'
#3 / c
#3 '+'
#3 '+'
#4 < > 5
#4 ERROR "!"
#4 '='
#4 = 120
#4 ','
#4 ~ 2
#4 '+'
#4 INT_CONST 2
#4 '='
#4 INT_CONST 5
#4 OBJECTID or
#4 TYPEID E
#4 '='
#4 OBJECTID mc2
#4 ';'
#4 OBJECTID p
#4 '+'
#4 INT_CONST 1
#4 '@'
#4 OBJECTID p
#4 '='
#4 INT_CONST 1
#4 ':'
#4 OBJECTID for
#4 OBJECTID x
#4 IN
#4 OBJECTID range
#4 '('
#4 OBJECTID len
#4 '('
#4 OBJECTID b
#4 ')'
#4 ')'
#5 NEW
#5 '/'
#5 ASSIGN
#5 '<'
#5 LE
#5 DARROW
#5 '{'
#5 '('
#5 TYPEID Int
#5 ':'
#5 TYPEID Objet
#5 ','
#5 TYPEID Bool
#5 ';'
#5 TYPEID String
#5 '.'
#5 OBJECTID string
#5 TYPEID SELF_TYPE
#5 ISVOID
#5 '}'
#5 ')'
#6 CLASS
#6 CLASS
#6 IF
#6 THEN
#6 ELSE
#6 FI
#6 OBJECTID testing
#6 TYPEID Testing
#6 '~'
#6 INT_CONST 007
#6 OBJECTID agent_bond
#6 OBJECTID james_007B0N3SS___
#7 LOOP
#7 POOL
#7 WHILE
#7 BOOL_CONST true
#7 OBJECTID or
#7 NOT
#7 BOOL_CONST false
#7 LET
#7 IN
#7 CASE
#7 OF
#7 ESAC
*)

"asd
15 changes: 15 additions & 0 deletions customized_tests/lexer/test_comment.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--Any characters between two dashes “--” and the next newline
--(or EOF, if there is no next newline) are treated as comments

(*(*(*
Comments may also be written by enclosing
text in (∗ . . . ∗). The latter form 8 of comment may be nested.
Comments cannot cross file boundaries.
*)*)*)

class Error() {

(* case There was once a comment,
that was quite long.
But, the. Now, reader; is the comment
ever gonna end?
9 changes: 9 additions & 0 deletions customized_tests/lexer/tryNoSymbol.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
class Cons {
xcar : Int ;
xcdr : String ;

isNill ( ) : Bool {
false
} ;
}
15 changes: 15 additions & 0 deletions customized_tests/parser/missingcpar.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

class Main {
main(): Object {
(new Alpha).print()
};
};


class Test {
testing8(x: Int, y: Int): Bool {
let z: Int <- 3, w: Int <- 4
-- Missing ')'
in isvoid (3 + a * (x / w + new Int) - y - (((if tRue = not faLSe then ~z else 3 <= 4 + "hey".length() fi + a)/(0)*(((4 * 4)))))
};
};
Loading