if ($6 != null) {\r
field_def.AddDataValue ((DataConstant) $6);\r
}\r
+ */\r
if ($7 != null) {\r
- field_def.AddValue ((Constant) $7);\r
+ field_def.SetValue ((Constant) $7);\r
}\r
- */\r
}\r
;\r
\r
;\r
\r
data_decl : data_head data_body\r
+ {\r
+ /*\r
+ Console.WriteLine ("Creating data decl: '{0}' '{1}'", $1, $2);\r
+\r
+ DataDef datadef = (DataDef) $1;\r
+ \r
+ if ($2 is ArrayList) {\r
+ ArrayList const_list = (ArrayList) $2;\r
+ DataConstant[] const_arr = new DataConstant[const_list.Count];\r
+ \r
+ for (int i=0; i<const_arr.Length; i++)\r
+ const_arr[i] = (DataConstant) const_list[i];\r
+\r
+ datadef.PeapiConstant = new ArrayConstant (const_arr);\r
+ } else {\r
+ datadef.PeapiConstant = (PEAPI.Constant) $2;\r
+ }\r
+ */\r
+ }\r
;\r
\r
-data_head : D_DATA tls id ASSIGN \r
+data_head : D_DATA tls id ASSIGN\r
+ {\r
+ \r
+ $$ = new DataDef ((string) $3, (bool)\r
+ $2);\r
+ \r
+ } \r
| D_DATA tls\r
+ {\r
+ \r
+ $$ = new DataDef (String.Empty, (bool) $2);\r
+ \r
+ }\r
;\r
\r
-tls : /* EMPTY */\r
- | K_TLS\r
+tls : /* EMPTY */ { $$ = false; }\r
+ | K_TLS { $$ = true; }\r
;\r
\r
data_body : OPEN_BRACE dataitem_list CLOSE_BRACE\r
| K_FLOAT32 OPEN_PARENS float64 CLOSE_PARENS repeat_opt\r
{\r
FloatConst float_const = new FloatConst ((float) $3);\r
- $$ = new RepeatedConstant (float_const, (int) $5);\r
+\r
+ if ($5 != null)\r
+ $$ = new RepeatedConstant (float_const, (int) $5);\r
+ else\r
+ $$ = float_const;\r
}\r
| K_FLOAT64 OPEN_PARENS float64 CLOSE_PARENS repeat_opt\r
{\r
DoubleConst double_const = new DoubleConst ((double) $3);\r
- $$ = new RepeatedConstant (double_const, (int) $5);\r
+\r
+ if ($5 != null)\r
+ $$ = new RepeatedConstant (double_const, (int) $5);\r
+ else\r
+ $$ = double_const;\r
}\r
| K_INT64 OPEN_PARENS int64 CLOSE_PARENS repeat_opt\r
{\r
IntConst int_const = new IntConst ((long) $3);\r
- $$ = new RepeatedConstant (int_const, (int) $5);\r
+\r
+ if ($5 != null)\r
+ $$ = new RepeatedConstant (int_const, (int) $5);\r
+ else\r
+ $$ = int_const;\r
}\r
| K_INT32 OPEN_PARENS int32 CLOSE_PARENS repeat_opt\r
{\r
IntConst int_const = new IntConst ((int) $3);\r
- $$ = new RepeatedConstant (int_const, (int) $5);\r
+\r
+ if ($5 != null)\r
+ $$ = new RepeatedConstant (int_const, (int) $5);\r
+ else\r
+ $$ = int_const;\r
}\r
| K_INT16 OPEN_PARENS int32 CLOSE_PARENS repeat_opt\r
{\r
IntConst int_const = new IntConst ((short) $3);\r
- $$ = new RepeatedConstant (int_const, (int) $5);\r
+\r
+ if ($5 != null)\r
+ $$ = new RepeatedConstant (int_const, (int) $5);\r
+ else\r
+ $$ = int_const;\r
}\r
| K_INT8 OPEN_PARENS int32 CLOSE_PARENS repeat_opt\r
{\r
IntConst int_const = new IntConst ((sbyte) $3);\r
- $$ = new RepeatedConstant (int_const, (int) $5);\r
+\r
+ if ($5 != null)\r
+ $$ = new RepeatedConstant (int_const, (int) $5);\r
+ else\r
+ $$ = int_const;\r
}\r
| K_FLOAT32 repeat_opt\r
{\r
FloatConst float_const = new FloatConst (0F);\r
- $$ = new RepeatedConstant (float_const, (int) $2);\r
+\r
+ if ($2 != null)\r
+ $$ = new RepeatedConstant (float_const, (int) $2);\r
+ else\r
+ $$ = float_const;\r
}\r
| K_FLOAT64 repeat_opt\r
{\r
DoubleConst double_const = new DoubleConst (0);\r
- $$ = new RepeatedConstant (double_const, (int) $2);\r
+\r
+ if ($2 != null)\r
+ $$ = new RepeatedConstant (double_const, (int) $2);\r
+ else\r
+ $$ = double_const;\r
}\r
| K_INT64 repeat_opt\r
{\r
IntConst int_const = new IntConst ((long) 0);\r
- $$ = new RepeatedConstant (int_const, (int) $2);\r
+\r
+ if ($2 != null)\r
+ $$ = new RepeatedConstant (int_const, (int) $2);\r
+ else\r
+ $$ = int_const;\r
}\r
| K_INT32 repeat_opt\r
{\r
IntConst int_const = new IntConst ((int) 0);\r
- $$ = new RepeatedConstant (int_const, (int) $2);\r
+\r
+ if ($2 != null)\r
+ $$ = new RepeatedConstant (int_const, (int) $2);\r
+ else\r
+ $$ = int_const;\r
}\r
| K_INT16 repeat_opt\r
{\r
IntConst int_const = new IntConst ((short) 0);\r
- $$ = new RepeatedConstant (int_const, (int) $2);\r
+\r
+ if ($2 != null)\r
+ $$ = new RepeatedConstant (int_const, (int) $2);\r
+ else\r
+ $$ = int_const;\r
}\r
| K_INT8 repeat_opt\r
{\r
IntConst int_const = new IntConst ((sbyte) 0);\r
- $$ = new RepeatedConstant (int_const, (int) $2);\r
+\r
+ if ($2 != null)\r
+ $$ = new RepeatedConstant (int_const, (int) $2);\r
+ else\r
+ $$ = int_const;\r
}\r
;\r
\r
method_all : method_head OPEN_BRACE method_decls CLOSE_BRACE\r
+ {\r
+ codegen.EndMethodDef ();\r
+ }\r
;\r
\r
method_head : D_METHOD meth_attr call_conv param_attr type method_name\r