Skip to content

Commit

Permalink
changement nom méthode
Browse files Browse the repository at this point in the history
  • Loading branch information
Claire0607 committed May 30, 2024
1 parent 0a8726e commit 855d0b0
Show file tree
Hide file tree
Showing 17 changed files with 95 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,15 @@ public Fragment getCode(TAMFactory _factory) {
List<ParameterDeclaration> parameters = this.entete.getParametres();
Fragment frag = _factory.createFragment();

//On vérifie si le corps n'est pas null (méthode abstraite)
//On vérifie si le corps n'est pas null (méthode abstraite par exemple)
if (this.corps != null) {
frag.append(this.corps.getCode(_factory));
frag.addPrefix(this.entete.getName());
List<ParameterDeclaration> param = this.entete.getParametres();
String str = "";
for (ParameterDeclaration p : param) {
str = str + "_" + p.getType();
}
frag.addPrefix(this.entete.getName()+str);
frag.addComment(this.toString());
}
return frag;
Expand Down
6 changes: 3 additions & 3 deletions fr.n7.stl.block/test-mjava/tam/OK_parser01.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;int a = 0;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@677327b6
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@4c873330
main_(String [])
PUSH 1
LOADL 0
STORE (1) 1[SB]
Expand All @@ -10,7 +10,7 @@ LOADA 1[SB]
STOREI (1)
;int b = a;
PUSH 1
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@1540e19d
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@7229724f
LOAD (1) 1[SB]
STORE (1) 2[SB]
POP (0) 2
Expand Down
6 changes: 3 additions & 3 deletions fr.n7.stl.block/test-mjava/tam/OK_parser02.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;int a = 0;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@6d6f6e28
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@3b07d329
main_(String [])
PUSH 1
LOADL 0
STORE (1) 1[SB]
Expand All @@ -10,7 +10,7 @@ LOADA 1[SB]
STOREI (1)
;int b = a;
PUSH 1
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@7f31245a
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@4eec7777
LOAD (1) 1[SB]
STORE (1) 2[SB]
POP (0) 2
Expand Down
8 changes: 4 additions & 4 deletions fr.n7.stl.block/test-mjava/tam/OK_parser03.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;int a = 0;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@2503dbd3
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@3d075dc0
main_(String [])
PUSH 1
LOADL 0
STORE (1) 1[SB]
Expand All @@ -10,11 +10,11 @@ LOADA 1[SB]
STOREI (1)
;int b = a;
PUSH 1
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@330bedb4
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@682a0b20
LOAD (1) 1[SB]
STORE (1) 2[SB]
POP (0) 2
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@4b67cf4d
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@214c265e
A
POP (0) 0
HALT
Expand Down
12 changes: 6 additions & 6 deletions fr.n7.stl.block/test-mjava/tam/OK_parser03bis.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;int a = 0;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@6e0be858
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@7699a589
main_(String [])
PUSH 1
LOADL 0
STORE (1) 1[SB]
Expand All @@ -10,15 +10,15 @@ LOADA 1[SB]
STOREI (1)
;int b = a;
PUSH 1
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@5cad8086
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@3b9a45b3
LOAD (1) 1[SB]
STORE (1) 2[SB]
POP (0) 2
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@61bbe9ba
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@58372a00
A
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@610455d6
m
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@4dd8dc3
m_int
POP (0) 0
HALT

8 changes: 4 additions & 4 deletions fr.n7.stl.block/test-mjava/tam/OK_parser04.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;int a = 0;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@6f496d9f
main
main_(String [])
PUSH 1
LOADL 0
STORE (1) 1[SB]
Expand All @@ -18,7 +18,7 @@ POP (0) 2
B
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@10f87f48
abc
abc_int
RETURN (1) 1
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@b4c966a
Expand All @@ -32,7 +32,7 @@ POP (0) 0
m
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@1d81eb93
n
n_int
RETURN (1) 1
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@7291c18f
Expand All @@ -49,7 +49,7 @@ POP (0) 0
m
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@12edcd21
n
n_int
RETURN (1) 1
POP (0) 0
HALT
Expand Down
2 changes: 1 addition & 1 deletion fr.n7.stl.block/test-mjava/tam/OK_parser06.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@4edde6e5
main
main_(String [])
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@70177ecd
m
Expand Down
18 changes: 9 additions & 9 deletions fr.n7.stl.block/test-mjava/tam/OK_parser07.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@2dda6444
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@6576fe71
main_(String [])
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@5e9f23b4
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@76fb509a
m
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@4783da3f
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@300ffa5d
B
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@378fd1ac
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@1f17ae12
A
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@49097b5d
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@4d405ef7
A
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@6e2c634b
m
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@6193b845
m_int
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@37a71e93
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@2e817b38
m
POP (0) 0
LOADL 1
Expand Down
4 changes: 2 additions & 2 deletions fr.n7.stl.block/test-mjava/tam/OK_test00.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@2e817b38
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@20ad9418
main_String
POP (0) 0
HALT

4 changes: 2 additions & 2 deletions fr.n7.stl.block/test-mjava/tam/OK_test01.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@433c675d
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@439f5b3d
main_String
POP (0) 0
HALT

6 changes: 3 additions & 3 deletions fr.n7.stl.block/test-mjava/tam/OK_test02.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;int a = 1;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@179d3b25
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@2e0fa5d3
main_(String [])
PUSH 1
LOADL 1
STORE (1) 1[SB]
Expand All @@ -10,7 +10,7 @@ LOADL 1
STORE (1) 2[SB]
POP (0) 2
;int a = 1;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@5d099f62
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@685f4c2e
m
PUSH 1
LOADL 1
Expand Down
12 changes: 6 additions & 6 deletions fr.n7.stl.block/test-mjava/tam/OK_test03.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;int a = 1;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@5197848c
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@21b8d17c
main_(String [])
PUSH 1
LOADL 1
STORE (1) 1[SB]
Expand All @@ -10,21 +10,21 @@ LOADL 1
STORE (1) 2[SB]
POP (0) 2
;int a = (arg1 * 2);
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@7daf6ecc
m
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@246b179d
m_int
PUSH 1
;(arg1 * 2)
LOAD (1) 0[LB]
LOADL 2
SUBR IMul
STORE (1) 2[SB]
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@685f4c2e
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@533ddba
;print a;
LOAD (1) 2[SB]
SUBR IOut
POP (0) 1
;int a = 1;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@2e5d6d97
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@7a07c5b4
m
PUSH 1
LOADL 1
Expand Down
16 changes: 8 additions & 8 deletions fr.n7.stl.block/test-mjava/tam/OK_test05.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;int a = 1;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@6433a2
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@306a30c7
main_(String [])
PUSH 1
LOADL 1
STORE (1) 1[SB]
Expand All @@ -10,33 +10,33 @@ LOADL 1
STORE (1) 2[SB]
POP (0) 2
;print 3;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@5910e440
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@b81eda8
print3
LOADL 3
SUBR IOut
POP (0) 0
;print 2;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@6267c3bb
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@68de145
m
LOADL 2
SUBR IOut
POP (0) 0
;int a = (arg1 * 2);
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@246b179d
m
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@46f7f36a
m_int
PUSH 1
;(arg1 * 2)
LOAD (1) 0[LB]
LOADL 2
SUBR IMul
STORE (1) 2[SB]
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@533ddba
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@27fa135a
;print a;
LOAD (1) 2[SB]
SUBR IOut
POP (0) 1
;int a = 1;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@7a07c5b4
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@421faab1
m
PUSH 1
LOADL 1
Expand Down
22 changes: 11 additions & 11 deletions fr.n7.stl.block/test-mjava/tam/OK_test06.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;int a = 1;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@27fa135a
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@799f7e29
main_(String [])
PUSH 1
LOADL 1
STORE (1) 1[SB]
Expand All @@ -10,42 +10,42 @@ LOADL 1
STORE (1) 2[SB]
POP (0) 2
;print 3;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@46f7f36a
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@4b85612c
print3
LOADL 3
SUBR IOut
POP (0) 0
;print 2;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@421faab1
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@277050dc
m
LOADL 2
SUBR IOut
POP (0) 0
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@2b71fc7e
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@5c29bfd
B
POP (0) 0
;print idx;
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@5ce65a89
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@7aec35a
B
LOAD (1) 0[LB]
SUBR IOut
POP (0) 0
;int a = (arg1 * 2);
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@1a86f2f1
m
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@42110406
m_int
PUSH 1
;(arg1 * 2)
LOAD (1) 0[LB]
LOADL 2
SUBR IMul
STORE (1) 5[SB]
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@25f38edc
;fr.n7.stl.block.ast.expression.accessible.VariableAccess@67424e82
;print a;
LOAD (1) 5[SB]
SUBR IOut
POP (0) 1
;int a = 1;
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@3eb07fd3
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@531d72ca
m
PUSH 1
LOADL 1
Expand All @@ -59,7 +59,7 @@ LOADL 1
SUBR IOut
POP (0) 2
;print 0;
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@506c589e
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@22d8cfe0
A
LOADL 0
SUBR IOut
Expand Down
8 changes: 4 additions & 4 deletions fr.n7.stl.block/test-mjava/tam/OK_test10.mjava.tam
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@6e5e91e4
main
;fr.n7.stl.block.ast.instruction.declaration.MethodDeclaration@5b37e0d2
main_String
POP (0) 0
;int b = a;
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@30946e09
;fr.n7.stl.block.ast.instruction.declaration.ConstructorDeclaration@5a2e4553
A
PUSH 1
;fr.n7.stl.block.ast.expression.accessible.AttributeAccess@2cdf8d8a
;fr.n7.stl.block.ast.expression.accessible.AttributeAccess@4459eb14
LOAD (1) 1[SB]
STORE (1) 1[SB]
; a = 2;
Expand Down
Loading

0 comments on commit 855d0b0

Please sign in to comment.