]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/assembly/compiler/preast_tree.ma
Another bug.
[helm.git] / helm / software / matita / contribs / assembly / compiler / preast_tree.ma
index fcc1fbf4a7edea1690fe76bc262e2efba9770ca6..9a463d1b65cd055541bce891cfd4f2b243ec4a5f 100755 (executable)
@@ -20,8 +20,6 @@
 (* ********************************************************************** *)
 
 include "string/string.ma".
-include "compiler/utility.ma".
-include "freescale/word32.ma".
 include "compiler/ast_type.ma".
 
 (* ****************** *)
@@ -69,6 +67,25 @@ with preast_var : Type ≝
 
 (* -------------------------- *)
 
+(* inizializzatori: ... valori ... *)
+inductive preast_init_val : Type ≝
+  PREAST_INIT_VAL_BYTE8: byte8 → preast_init_val
+| PREAST_INIT_VAL_WORD16: word16 → preast_init_val
+| PREAST_INIT_VAL_WORD32: word32 → preast_init_val
+| PREAST_INIT_VAL_ARRAY: ne_list preast_init_val → preast_init_val
+| PREAST_INIT_VAL_STRUCT: ne_list preast_init_val → preast_init_val.
+
+(*
+ inizializzatori: ammesse solo due forme, no ibridi
+  1) var1 = var2
+  2) var = ... valori ...
+*)
+inductive preast_init : Type ≝
+  PREAST_INIT_VAR: preast_var → preast_init
+| PREAST_INIT_VAL: preast_init_val → preast_init.
+
+(* -------------------------- *)
+
 (* statement: assegnamento/while/if else if else *)
 inductive preast_stm : Type ≝
   PREAST_STM_ASG: preast_var → preast_expr → preast_stm
@@ -78,7 +95,7 @@ inductive preast_stm : Type ≝
 (* dichiarazioni *)
 with preast_decl : Type ≝
   PREAST_NO_DECL: list preast_stm → preast_decl
-| PREAST_DECL: bool → aux_str_type → ast_type → option preast_expr → preast_decl → preast_decl.
+| PREAST_DECL: bool → aux_str_type → ast_type → option preast_init → preast_decl → preast_decl.
 
 (* -------------------------- *)