1 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
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.
18 * expression.cs (New::NType): Add enumeration to help us
19 keep track of whether we have an object/delegate 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
27 * cs-parser.jay (array_creation_expression): Implement to call
28 the overloaded New constructor.
30 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
32 * class.cs (TypeContainer::Constructors): Return member
33 constructors instead of returning null.
35 2001-08-26 Miguel de Icaza <miguel@ximian.com>
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
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'.
46 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
47 generation from working. Also add some temporary debugging
50 2001-08-24 Miguel de Icaza <miguel@ximian.com>
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.
57 * gen-treedump.cs: Bug fix, use s.Increment here instead of
60 * codegen.cs (EmitContext): New struct, used during code
61 emission to keep a context. Most of the code generation will be
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.
67 2001-08-23 Miguel de Icaza <miguel@ximian.com>
69 * statement.cs: Add support for multiple child blocks.
71 2001-08-22 Miguel de Icaza <miguel@ximian.com>
73 * codegen.cs (EmitCode): New function, will emit the code for a
74 Block of code given a TypeContainer and its ILGenerator.
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.
81 * class.cs: Drop support for MethodGroups here, delay until
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
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
94 (Method::Define): Defines the type, a second pass is performed
95 later to populate the methods.
97 (Constructor::ParameterTypes): implement a cache similar to the
98 one on Method::ParameterTypes, useful later when we do semantic
101 (TypeContainer::EmitMethod): New method. Emits methods.
103 * expression.cs: Removed MethodGroup class from here.
105 * parameter.cs (Parameters::GetCallingConvention): new method.
107 2001-08-21 Miguel de Icaza <miguel@ximian.com>
109 * class.cs (TypeContainer::Populate): Drop RootContext from the
112 (Constructor::CallingConvention): Returns the calling convention.
113 (Constructor::ParameterTypes): Returns the constructor parameter
116 (TypeContainer::AddConstructor): Keep track of default constructor
117 and the default static constructor.
119 (Constructor::) Another class that starts using `public readonly'
120 instead of properties.
122 (Constructor::IsDefault): Whether this is a default constructor.
124 (Field::) use readonly public fields instead of properties also.
126 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
127 track of static constructors; If none is used, turn on
128 BeforeFieldInit in the TypeAttributes.
130 * cs-parser.jay (opt_argument_list): now the return can be null
131 for the cases where there are no arguments.
133 (constructor_declarator): If there is no implicit `base' or
134 `this', then invoke the default parent constructor.
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
141 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
143 2001-08-19 Miguel de Icaza <miguel@ximian.com>
145 * parameter.cs (GetParameterInfo): Fix bug where there would be no
148 * interface.cs (PopulateIndexer): Implemented the code generator
149 for interface indexers.
151 2001-08-17 Miguel de Icaza <miguel@ximian.com>
153 * interface.cs (InterfaceMemberBase): Now we track the new status
156 (PopulateProperty): Implement property population. Woohoo! Got
157 Methods and Properties going today.
159 Removed all the properties for interfaces, and replaced them with
160 `public readonly' fields.
162 2001-08-16 Miguel de Icaza <miguel@ximian.com>
164 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
165 initialize their hashtables/arraylists only when they are needed
166 instead of doing this always.
168 * parameter.cs: Handle refs and out parameters.
170 * cs-parser.jay: Use an ArrayList to construct the arguments
171 instead of the ParameterCollection, and then cast that to a
174 * parameter.cs: Drop the use of ParameterCollection and use
175 instead arrays of Parameters.
177 (GetParameterInfo): Use the Type, not the Name when resolving
180 2001-08-13 Miguel de Icaza <miguel@ximian.com>
182 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
183 and instead use public readonly fields.
185 * class.cs: Put back walking code for type containers.
187 2001-08-11 Miguel de Icaza <miguel@ximian.com>
189 * class.cs (MakeConstant): Code to define constants.
191 * rootcontext.cs (LookupType): New function. Used to locate types
194 2001-08-08 Miguel de Icaza <miguel@ximian.com>
196 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
197 this System.Reflection code is. Kudos to Microsoft
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!
203 * driver.cs: Make sure we always load mscorlib first (for
204 debugging purposes, nothing really important).
206 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
207 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
209 * rootcontext.cs: Lookup types on their namespace; Lookup types
210 on namespaces that have been imported using the `using' keyword.
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
219 * rootcontext.cs (GetClassBases): Added support for structs.
221 2001-08-06 Miguel de Icaza <miguel@ximian.com>
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.
227 2001-08-04 Miguel de Icaza <miguel@ximian.com>
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.
236 * cs-parser.jay (type_list): Oops, list production was creating a
237 new list of base types.
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
247 * driver.cs: Add support for --nostdlib, to avoid loading the
249 (Main): Do not put tree resolution here.
251 * rootcontext.cs: Beginning of the class resolution.
253 2001-08-03 Miguel de Icaza <miguel@ximian.com>
255 * rootcontext.cs: Provide better error reporting.
257 * cs-parser.jay (interface_base): set our $$ to be interfaces.
259 * rootcontext.cs (CreateInterface): Handle the case where there
260 are no parent interfaces.
262 (CloseTypes): Routine to flush types at the end.
263 (CreateInterface): Track types.
264 (GetInterfaces): Returns an array of Types from the list of
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
271 2001-08-02 Miguel de Icaza <miguel@ximian.com>
273 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
274 RecordInterface instead.
276 * cs-parser.jay: Updated to reflect changes above.
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.
282 * driver.cs: Smaller changes to accomodate the new code.
284 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
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
291 (CodeGen): Property, used to keep track of the code generator.
293 2001-07-26 Miguel de Icaza <miguel@ximian.com>
295 * cs-parser.jay: Add a second production for delegate_declaration
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.
302 (type_list): Need a COMMA in the middle.
304 (indexer_declaration): Tell tokenizer to recognize get/set
306 * Remove old targets.
308 * Re-add the parser target.
310 2001-07-13 Simon Cozens <simon@simon-cozens.org>
312 * cs-parser.jay: Add precendence rules for a number of operators
313 ot reduce the number of shift/reduce conflicts in the grammar.
315 2001-07-17 Miguel de Icaza <miguel@ximian.com>
317 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
320 Get rid of old crufty code.
322 * rootcontext.cs: Use this to keep track of the parsed
323 representation and the defined types available to the program.
325 * gen-treedump.cs: adjust for new convention.
327 * type.cs: Split out the type manager, and the assembly builder
330 * typemanager.cs: the type manager will live here now.
332 * cil-codegen.cs: And the code generator here.
334 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
336 * makefile: Fixed up for easy making.
338 2001-07-13 Simon Cozens <simon@simon-cozens.org>
340 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
343 (unary_expression): Expand pre_increment_expression and
344 post_decrement_expression to reduce a shift/reduce.
346 2001-07-11 Simon Cozens
348 * cs-tokenizer.cs: Hex numbers should begin with a 0.
350 Improve allow_keyword_as_indent name.
352 2001-06-19 Miguel de Icaza <miguel@ximian.com>
354 * Adjustments for Beta2.
356 2001-06-13 Miguel de Icaza <miguel@ximian.com>
358 * decl.cs: Added `Define' abstract method.
359 (InTransit): new property, used to catch recursive definitions.
361 * interface.cs: Implement `Define'.
363 * modifiers.cs: Map Modifiers.constants to
364 System.Reflection.TypeAttribute flags.
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.
371 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
372 that are inserted into the name space.
374 2001-06-08 Miguel de Icaza <miguel@ximian.com>
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.
379 * driver.cs: Objetify driver. Load assemblies, use assemblies to
382 2001-06-07 Miguel de Icaza <miguel@ximian.com>
384 * Experiment successful: Use System.Type rather that our own
387 2001-05-25 Miguel de Icaza <miguel@ximian.com>
389 * cs-parser.jay: Removed nsAliases from here.
391 Use new namespaces, handle `using XXX;'
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.
397 2001-05-24 Miguel de Icaza <miguel@ximian.com>
399 * gen-treedump.cs: Adapted for all the renaming.
401 * expression.cs (Expression): this class now has a Type property
402 which returns an expression Type.
404 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
405 `Type', as this has a different meaning now in the base
407 2001-05-22 Miguel de Icaza <miguel@ximian.com>
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:
416 void a (NS.Blah x) {}
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.
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.
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.
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.
436 2001-05-13 Miguel de Icaza <miguel@ximian.com>
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.
444 2001-05-10 Miguel de Icaza <miguel@ximian.com>
446 * class.cs (TypeContainer.AddMethod): we now add methods to the
447 MethodGroup instead of the method hashtable.
449 * expression.cs: Add MethodGroup abstraction, which gets us one
450 step closer to the specification in the way we handle method
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.
457 current_local_parameters is now a parser global variable that
458 points to the current parameters for the block, used during name
461 (property_declaration): Now creates an implicit `value' argument to
464 2001-05-09 Miguel de Icaza <miguel@ximian.com>
466 * parameter.cs: Do not use `param' arguments as part of the
467 signature, per the spec.
469 2001-05-08 Miguel de Icaza <miguel@ximian.com>
471 * decl.cs: Base class for classes, structs and interfaces. This
472 is the "Declaration Space"
474 * cs-parser.jay: Use CheckDef for checking declaration errors
475 instead of having one on each function.
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.
481 * interface.cs: Make all interface member classes derive from
484 2001-05-07 Miguel de Icaza <miguel@ximian.com>
486 * Many things: all interfaces are parsed and generated in
487 gen-treedump. Support for member variables, constructors,
488 destructors, properties, constants is there.
490 Beginning of the IL backend, but very little done, just there for
493 2001-04-29 Miguel de Icaza <miguel@ximian.com>
495 * cs-parser.jay: Fix labeled statement.
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.
502 2001-04-27 Miguel de Icaza <miguel@ximian.com>
504 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
505 to match the values in System.CodeDOM.
507 Divid renamed to Divide.
509 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
511 (Statements.set): remove.
513 * System.CodeDOM/CodeCatchClause.cs: always have a valid
516 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
517 falseStatements always have valid values.
519 * cs-parser.jay: Use System.CodeDOM now.