+ Block assign_block = new Block (current_block);
+ current_block = assign_block;
+
+ oob_stack.Push (lexer.Location);
+
+ if ($3 is DictionaryEntry){
+ DictionaryEntry de = (DictionaryEntry) $3;
+ Location l = lexer.Location;
+
+ string type = (string) de.Key;
+ ArrayList var_declarators = (ArrayList) de.Value;
+
+ foreach (VariableDeclaration decl in var_declarators){
+ if (current_block.AddVariable (
+ type, decl.identifier,
+ current_local_parameters, decl.Location) == null){
+ Report.Error (128, decl.Location,
+ "A local variable `" + decl.identifier + "' is already" +
+ "defined in this scope");
+ }
+ }
+
+ ArrayList vars = new ArrayList ();
+
+ foreach (VariableDeclaration decl in var_declarators){
+
+ Expression expr;
+ if (decl.expression_or_array_initializer is Expression){
+ expr = (Expression) decl.expression_or_array_initializer;
+
+ } else {
+
+ ArrayList init = (ArrayList) decl.expression_or_array_initializer;
+
+ string base_type = type.Substring (0, type.IndexOf ("["));
+ string rank = type.Substring (type.IndexOf ("["));
+
+ expr = new ArrayCreation (base_type, rank, init, decl.Location);
+ }
+
+ LocalVariableReference var;
+ VariableInfo vi;
+
+ var = new LocalVariableReference (assign_block, decl.identifier, l);
+ vi = var.VariableInfo;
+ vi.ReadOnly = true;
+
+ // This is so that it is not a warning on using variables
+ vi.Used = true;
+
+ vars.Add (new DictionaryEntry (var, expr));
+
+ // Assign a = new Assign (var, expr, decl.Location);
+ // assign_block.AddStatement (new StatementExpression (a, lexer.Location));
+ }
+ $3 = new DictionaryEntry (type, vars);
+ }