2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
[mono.git] / mcs / mcs / ChangeLog
1 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
2
3         * cs-parser.jay (dim_separators): Implement. Make it a string
4         concatenating all the commas together, just as they appear.
5         (opt_dim_separators): Modify accordingly
6         (rank_specifiers): Update accordingly. Basically do the same
7         thing - instead, collect the brackets here.
8         (opt_rank_sepcifiers): Modify accordingly.
9         (array_type): Modify to actually return the complete type string
10         instead of ignoring the rank_specifiers.
11         (expression_list): Implement to collect the expressions
12         (variable_initializer): Implement. We make it a list of expressions
13         essentially so that we can handle the array_initializer case neatly too.
14         (variable_initializer_list): Implement.
15         (array_initializer): Make it a list of variable_initializers
16         (opt_array_initializer): Modify accordingly.
17
18         * expression.cs (New::NType): Add enumeration to help us
19         keep track of whether we have an object/delegate creation
20         or an array creation.
21         (New:NewType, New::Rank, New::Indices, New::Initializers): New
22         members to hold data about array creation.
23         (New:New): Modify to update NewType
24         (New:New): New Overloaded contructor for the array creation
25         case.
26
27         * cs-parser.jay (array_creation_expression): Implement to call
28         the overloaded New constructor.
29         
30 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
31
32         * class.cs (TypeContainer::Constructors): Return member
33         constructors instead of returning null.
34
35 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
36
37         * typemanager.cs (InitCoreTypes): Initialize the various core
38         types after we have populated the type manager with the user
39         defined types (this distinction will be important later while
40         compiling corlib.dll)
41
42         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
43         on Expression Classification.  Now all expressions have a method
44         `Resolve' and a method `Emit'.
45
46         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
47         generation from working.     Also add some temporary debugging
48         code. 
49         
50 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
51
52         * codegen.cs: Lots of code generation pieces.  This is only the
53         beginning, will continue tomorrow with more touches of polish.  We
54         handle the fundamentals of if, while, do, for, return.  Others are
55         trickier and I need to start working on invocations soon.
56         
57         * gen-treedump.cs: Bug fix, use s.Increment here instead of
58         s.InitStatement. 
59
60         * codegen.cs (EmitContext): New struct, used during code
61         emission to keep a context.   Most of the code generation will be
62         here. 
63
64         * cs-parser.jay: Add embedded blocks to the list of statements of
65         this block.  So code generation proceeds in a top down fashion.
66
67 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
68
69         * statement.cs: Add support for multiple child blocks.
70
71 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
72
73         * codegen.cs (EmitCode): New function, will emit the code for a
74         Block of code given a TypeContainer and its ILGenerator. 
75
76         * statement.cs (Block): Standard public readonly optimization.
77         (Block::Block constructors): Link children. 
78         (Block::Child): Child Linker.
79         (Block::EmitVariables): Emits IL variable declarations.
80
81         * class.cs: Drop support for MethodGroups here, delay until
82         Semantic Analysis.
83         (Method::): Applied the same simplification that I did before, and
84         move from Properties to public readonly fields.
85         (Method::ParameterTypes): Returns the parameter types for the
86         function, and implements a cache that will be useful later when I
87         do error checking and the semantic analysis on the methods is
88         performed.
89         (Constructor::GetCallingConvention): Renamed from CallingConvetion
90         and made a method, optional argument tells whether this is a class
91         or a structure to apply the `has-this' bit.
92         (Method::GetCallingConvention): Implement, returns the calling
93         convention. 
94         (Method::Define): Defines the type, a second pass is performed
95         later to populate the methods.
96
97         (Constructor::ParameterTypes): implement a cache similar to the
98         one on Method::ParameterTypes, useful later when we do semantic
99         analysis. 
100
101         (TypeContainer::EmitMethod):  New method.  Emits methods.
102
103         * expression.cs: Removed MethodGroup class from here.
104         
105         * parameter.cs (Parameters::GetCallingConvention): new method.
106
107 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
108
109         * class.cs (TypeContainer::Populate): Drop RootContext from the
110         argument. 
111
112         (Constructor::CallingConvention): Returns the calling convention.
113         (Constructor::ParameterTypes): Returns the constructor parameter
114         types. 
115         
116         (TypeContainer::AddConstructor): Keep track of default constructor
117         and the default static constructor.
118
119         (Constructor::) Another class that starts using `public readonly'
120         instead of properties. 
121
122         (Constructor::IsDefault): Whether this is a default constructor. 
123
124         (Field::) use readonly public fields instead of properties also.
125
126         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
127         track of static constructors;  If none is used, turn on
128         BeforeFieldInit in the TypeAttributes. 
129
130         * cs-parser.jay (opt_argument_list): now the return can be null
131         for the cases where there are no arguments. 
132
133         (constructor_declarator): If there is no implicit `base' or
134         `this', then invoke the default parent constructor. 
135         
136         * modifiers.cs (MethodAttr): New static function maps a set of
137         modifiers flags into a MethodAttributes enum
138         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
139         MethodAttr, TypeAttr to represent the various mappings where the
140         modifiers are used.
141         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
142
143 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
144
145         * parameter.cs (GetParameterInfo): Fix bug where there would be no
146         method arguments.
147
148         * interface.cs (PopulateIndexer): Implemented the code generator
149         for interface indexers.
150
151 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
152
153         * interface.cs (InterfaceMemberBase): Now we track the new status
154         here.  
155
156         (PopulateProperty): Implement property population.  Woohoo!  Got
157         Methods and Properties going today. 
158
159         Removed all the properties for interfaces, and replaced them with
160         `public readonly' fields. 
161
162 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
163
164         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
165         initialize their hashtables/arraylists only when they are needed
166         instead of doing this always.
167
168         * parameter.cs: Handle refs and out parameters.
169
170         * cs-parser.jay: Use an ArrayList to construct the arguments
171         instead of the ParameterCollection, and then cast that to a
172         Parameter[] array.
173
174         * parameter.cs: Drop the use of ParameterCollection and use
175         instead arrays of Parameters.
176
177         (GetParameterInfo): Use the Type, not the Name when resolving
178         types. 
179
180 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
181
182         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
183         and instead use public readonly fields.
184
185         * class.cs: Put back walking code for type containers.
186
187 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
188
189         * class.cs (MakeConstant): Code to define constants.
190
191         * rootcontext.cs (LookupType): New function.  Used to locate types 
192
193         
194 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
195
196         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
197         this System.Reflection code is.  Kudos to Microsoft
198         
199         * typemanager.cs: Implement a type cache and avoid loading all
200         types at boot time.  Wrap in LookupType the internals.  This made
201         the compiler so much faster.  Wow.  I rule!
202         
203         * driver.cs: Make sure we always load mscorlib first (for
204         debugging purposes, nothing really important).
205
206         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
207         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
208
209         * rootcontext.cs: Lookup types on their namespace;  Lookup types
210         on namespaces that have been imported using the `using' keyword.
211
212         * class.cs (TypeContainer::TypeAttr): Virtualize.
213         (Class::TypeAttr): Return attributes suitable for this bad boy.
214         (Struct::TypeAttr): ditto.
215         Handle nested classes.
216         (TypeContainer::) Remove all the type visiting code, it is now
217         replaced with the rootcontext.cs code
218
219         * rootcontext.cs (GetClassBases): Added support for structs. 
220
221 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
222
223         * interface.cs, statement.cs, class.cs, parameter.cs,
224         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
225         Drop use of TypeRefs, and use strings instead.
226
227 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
228
229         * rootcontext.cs: 
230
231         * class.cs (Struct::Struct): set the SEALED flags after
232         checking the modifiers.
233         (TypeContainer::TypeAttr): new property, returns the
234         TypeAttributes for a class.  
235
236         * cs-parser.jay (type_list): Oops, list production was creating a
237         new list of base types.
238
239         * rootcontext.cs (StdLib): New property.
240         (GetInterfaceTypeByName): returns an interface by type name, and
241         encapsulates error handling here.
242         (GetInterfaces): simplified.
243         (ResolveTree): Encapsulated all the tree resolution here.
244         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
245         types. 
246         
247         * driver.cs: Add support for --nostdlib, to avoid loading the
248         default assemblies.
249         (Main): Do not put tree resolution here. 
250
251         * rootcontext.cs: Beginning of the class resolution.
252
253 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
254
255         * rootcontext.cs: Provide better error reporting. 
256
257         * cs-parser.jay (interface_base): set our $$ to be interfaces.
258
259         * rootcontext.cs (CreateInterface): Handle the case where there
260         are no parent interfaces.
261         
262         (CloseTypes): Routine to flush types at the end.
263         (CreateInterface): Track types.
264         (GetInterfaces): Returns an array of Types from the list of
265         defined interfaces.
266
267         * typemanager.c (AddUserType): Mechanism to track user types (puts
268         the type on the global type hash, and allows us to close it at the
269         end). 
270         
271 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
272
273         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
274         RecordInterface instead.
275
276         * cs-parser.jay: Updated to reflect changes above.
277
278         * decl.cs (Definition): Keep track of the TypeBuilder type that
279         represents this type here.  Not sure we will use it in the long
280         run, but wont hurt for now.
281
282         * driver.cs: Smaller changes to accomodate the new code.
283
284         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
285         when done. 
286
287         * rootcontext.cs (CreateInterface):  New method, used to create
288         the System.TypeBuilder type for interfaces.
289         (ResolveInterfaces): new entry point to resolve the interface
290         hierarchy. 
291         (CodeGen): Property, used to keep track of the code generator.
292
293 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
294
295         * cs-parser.jay: Add a second production for delegate_declaration
296         with `VOID'.
297
298         (enum_body): Put an opt_comma here instead of putting it on
299         enum_body or enum_member_declarations so we can handle trailing
300         commas on enumeration members.  Gets rid of a shift/reduce.
301         
302         (type_list): Need a COMMA in the middle.
303
304         (indexer_declaration): Tell tokenizer to recognize get/set
305
306         * Remove old targets.
307
308         * Re-add the parser target.
309
310 2001-07-13  Simon Cozens <simon@simon-cozens.org>
311
312         * cs-parser.jay: Add precendence rules for a number of operators
313         ot reduce the number of shift/reduce conflicts in the grammar.
314         
315 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
316
317         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
318         and put it here.
319
320         Get rid of old crufty code.
321
322         * rootcontext.cs: Use this to keep track of the parsed
323         representation and the defined types available to the program. 
324
325         * gen-treedump.cs: adjust for new convention.
326
327         * type.cs: Split out the type manager, and the assembly builder
328         from here. 
329
330         * typemanager.cs: the type manager will live here now.
331
332         * cil-codegen.cs: And the code generator here. 
333
334 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
335
336         * makefile: Fixed up for easy making.
337
338 2001-07-13  Simon Cozens <simon@simon-cozens.org>
339
340         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
341         the 
342
343         (unary_expression): Expand pre_increment_expression and
344         post_decrement_expression to reduce a shift/reduce.
345
346 2001-07-11  Simon Cozens
347
348         * cs-tokenizer.cs: Hex numbers should begin with a 0.
349
350         Improve allow_keyword_as_indent name.
351
352 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
353
354         * Adjustments for Beta2. 
355
356 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
357
358         * decl.cs: Added `Define' abstract method.
359         (InTransit): new property, used to catch recursive definitions. 
360
361         * interface.cs: Implement `Define'. 
362
363         * modifiers.cs: Map Modifiers.constants to
364         System.Reflection.TypeAttribute flags.
365
366         * class.cs: Keep track of types and user-defined types.
367         (BuilderInit): New method for creating an assembly
368         (ResolveType): New function to launch the resolution process, only
369         used by interfaces for now.
370
371         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
372         that are inserted into the name space. 
373
374 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
375
376         * ARGH.  I have screwed up my tree so many times due to the use of
377         rsync rather than using CVS.  Going to fix this at once. 
378
379         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
380         load types.
381
382 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
383
384         * Experiment successful: Use System.Type rather that our own
385         version of Type.  
386
387 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
388
389         * cs-parser.jay: Removed nsAliases from here.
390
391         Use new namespaces, handle `using XXX;' 
392
393         * namespace.cs: Reimplemented namespace handling, use a recursive
394         definition of the class.  Now we can keep track of using clauses
395         and catch invalid using clauses.
396
397 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
398
399         * gen-treedump.cs: Adapted for all the renaming.
400
401         * expression.cs (Expression): this class now has a Type property
402         which returns an expression Type.
403
404         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
405         `Type', as this has a different meaning now in the base
406
407 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
408
409         * interface.cs, class.cs: Removed from all the sources the
410         references to signature computation, as we can not do method
411         signature computation during the parsing time, as we are not
412         trying to solve at that point distinguishing:
413
414         class X {
415                 void a (Blah x) {}
416                 void a (NS.Blah x) {}
417         }
418
419         Which depending on the context might be valid or not, as we do not
420         know if Blah is the same thing as NS.Blah at that point.
421
422         * Redid everything so the code uses TypeRefs now instead of
423         Types.  TypeRefs are just temporary type placeholders, that need
424         to be resolved.  They initially have a pointer to a string and the
425         current scope in which they are used.  This is used later by the
426         compiler to resolve the reference to an actual Type. 
427
428         * DeclSpace is no longer a CIR.Type, and neither are
429         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
430         are all DeclSpaces, but no Types. 
431
432         * type.cs (TypeRefManager): This implements the TypeRef manager,
433         which keeps track of all the types that need to be resolved after
434         the parsing has finished. 
435
436 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
437
438         * ARGH.  We are going to have to store `foreach' as a class rather
439         than resolving it, as we need to verify error 1579 after name
440         resolution.   *OR* we could keep a flag that says `This request to
441         IEnumerator comes from a foreach statement' which we can then use
442         to generate the error.
443
444 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
445
446         * class.cs (TypeContainer.AddMethod): we now add methods to the
447         MethodGroup instead of the method hashtable.  
448
449         * expression.cs: Add MethodGroup abstraction, which gets us one
450         step closer to the specification in the way we handle method
451         declarations.  
452
453         * cs-parser.jay (primary_expression): qualified_identifier now
454         tried to match up an identifier to a local variable reference or
455         to a parameter reference.
456
457         current_local_parameters is now a parser global variable that
458         points to the current parameters for the block, used during name
459         lookup.
460
461         (property_declaration): Now creates an implicit `value' argument to
462         the set accessor.
463
464 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
465
466         * parameter.cs: Do not use `param' arguments as part of the
467         signature, per the spec.
468
469 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
470
471         * decl.cs: Base class for classes, structs and interfaces.  This
472         is the "Declaration Space" 
473
474         * cs-parser.jay: Use CheckDef for checking declaration errors
475         instead of having one on each function.
476
477         * class.cs: Factor out some code for handling error handling in
478         accordance to the "Declarations" section in the "Basic Concepts"
479         chapter in the ECMA C# spec.
480
481         * interface.cs: Make all interface member classes derive from
482         InterfaceMemberBase.
483
484 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
485
486         * Many things: all interfaces are parsed and generated in
487         gen-treedump.  Support for member variables, constructors,
488         destructors, properties, constants is there.
489
490         Beginning of the IL backend, but very little done, just there for
491         testing purposes. 
492
493 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
494
495         * cs-parser.jay: Fix labeled statement.
496
497         * cs-tokenizer.cs (escape): Escape " and ' always.
498         ref_line, ref_name: keep track of the line/filename as instructed
499         by #line by the compiler.
500         Parse #line.
501
502 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
503
504         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
505         to match the values in System.CodeDOM.
506
507         Divid renamed to Divide.
508
509         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
510         statements. 
511         (Statements.set): remove.
512
513         * System.CodeDOM/CodeCatchClause.cs: always have a valid
514         statements. 
515
516         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
517         falseStatements always have valid values. 
518
519         * cs-parser.jay: Use System.CodeDOM now.
520