feat: wsh non en fait
This commit is contained in:
parent
951a1a441b
commit
cef62a7188
|
@ -0,0 +1,5 @@
|
|||
main{
|
||||
typedef Point = struct { int x int y };
|
||||
Point p = {1 2}
|
||||
print (p.x);
|
||||
}
|
|
@ -63,7 +63,6 @@ main : lfi=prog EOF {lfi}
|
|||
|
||||
prog :
|
||||
| ltd=td lf=fonc lfi=prog {let (Programme (_, lf1, li))=lfi in (Programme (ltd, lf::lf1,li))}
|
||||
(* | lf=fonc lfi=prog {let (Programme ( lf1, li))=lfi in (Programme ( lf::lf1,li))} *)
|
||||
| ID li=bloc {Programme ([], [], li)}
|
||||
|
||||
td :
|
||||
|
|
|
@ -101,6 +101,10 @@ and analyse_code_instruction i taille_return taille_args taille_var =
|
|||
(analyse_code_expression e) ^
|
||||
(analyse_code_affectable a) ^
|
||||
"STOREI (" ^ string_of_int (getTaille t) ^ ")\n"
|
||||
|
||||
| Attribut(aff, info) ->
|
||||
(analyse_code_affectable a)
|
||||
(* TODO *)
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -135,3 +135,7 @@ let%expect_test "typedef1" =
|
|||
let%expect_test "typedef2" =
|
||||
runtam "../../fichiersRat/src-rat-tam-test/typedef2.rat";
|
||||
[%expect{| 2 |}]
|
||||
|
||||
let%expect_test "struct1" =
|
||||
runtam "../../fichiersRat/src-rat-tam-test/struct1.rat";
|
||||
[%expect{| 1 |}]
|
Loading…
Reference in a new issue