1 2001-09-02 Miguel de Icaza <miguel@ximian.com>
3 * rootcontext.cs (RootContext::IsNamespace): new function, used to
4 tell whether an identifier represents a namespace.
6 * expression.cs (NamespaceExpr): A namespace expression, used only
7 temporarly during expression resolution.
8 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
9 utility functions to resolve names on expressions.
11 2001-09-01 Miguel de Icaza <miguel@ximian.com>
13 * codegen.cs: Add hook for StatementExpressions.
15 * class.cs: Fix inverted test for static flag in methods.
17 2001-09-02 Ravi Pratap <ravi@ximian.com>
19 * class.cs (Operator::CheckUnaryOperator): Correct error number used
20 to make it coincide with MS' number.
21 (Operator::CheckBinaryOperator): Ditto.
23 * ../errors/errors.txt : Remove error numbers added earlier.
25 * ../errors/cs1019.cs : Test case for error # 1019
27 * ../errros/cs1020.cs : Test case for error # 1020
29 * cs-parser.jay : Clean out commented cruft.
30 (dimension_separators, dimension_separator): Comment out. Ostensibly not
31 used anywhere - non-reducing rule.
32 (namespace_declarations): Non-reducing rule - comment out.
34 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
35 with TypeContainer::AddEnum.
37 * delegate.cs : New file for delegate handling classes.
38 (Delegate): Class for declaring delegates.
42 * cs-parser.jay (delegate_declaration): Implement.
44 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
46 * class.cs (Event::Define): Implement.
47 (Event.EventBuilder): New member.
49 * class.cs (TypeContainer::Populate): Update to define all enums and events
51 (Events): New property for the events arraylist we hold. Shouldn't we move to using
52 readonly fields for all these cases ?
54 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
56 * class.cs (Property): Revamp to use the convention of making fields readonly.
57 Accordingly modify code elsewhere.
59 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
60 the Define method of the Property class.
62 * class.cs : Clean up applied patch and update references to variables etc. Fix
64 (TypeContainer::Populate): Update to define all the properties we have. Also
65 define all enumerations.
67 * enum.cs (Define): Implement.
69 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
71 * cs-parser.jay (overloadable_operator): The semantic value is an
72 enum of the Operator class.
73 (operator_declarator): Implement actions.
74 (operator_declaration): Implement.
76 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
77 validity of definitions.
78 (Operator::CheckBinaryOperator): Static method to check for binary operators
79 (TypeContainer::AddOperator): New method to add an operator to a type.
81 * cs-parser.jay (indexer_declaration): Added line to actually call the
82 AddIndexer method so it gets added ;-)
84 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
85 already taken care of by the MS compiler ?
87 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
89 * class.cs (Operator): New class for operator declarations.
90 (Operator::OpType): Enum for the various operators.
92 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
94 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
95 ostensibly handle this in semantic analysis.
97 * cs-parser.jay (general_catch_clause): Comment out
98 (specific_catch_clauses, specific_catch_clause): Ditto.
99 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
100 (catch_args, opt_catch_args): New productions.
101 (catch_clause): Rewrite to use the new productions above
102 (catch_clauses): Modify accordingly.
103 (opt_catch_clauses): New production to use in try_statement
104 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
105 and re-write the code in the actions to extract the specific and
106 general catch clauses by being a little smart ;-)
108 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
109 Hooray, try and catch statements parse fine !
111 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
113 * statement.cs (Block::GetVariableType): Fix logic to extract the type
114 string from the hashtable of variables.
116 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
117 I end up making that mistake ;-)
118 (catch_clauses): Fixed gross error which made Key and Value of the
119 DictionaryEntry the same : $1 !!
121 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
123 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
125 * cs-parser.jay (event_declaration): Correct to remove the semicolon
126 when the add and remove accessors are specified.
128 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
130 * cs-parser.jay (IndexerDeclaration): New helper class to hold
131 information about indexer_declarator.
132 (indexer_declarator): Implement actions.
133 (parsing_indexer): New local boolean used to keep track of whether
134 we are parsing indexers or properties. This is necessary because
135 implicit_parameters come into picture even for the get accessor in the
137 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
139 * class.cs (Indexer): New class for indexer declarations.
140 (TypeContainer::AddIndexer): New method to add an indexer to a type.
141 (TypeContainer::indexers): New member to hold list of indexers for the
144 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
146 * cs-parser.jay (add_accessor_declaration): Implement action.
147 (remove_accessor_declaration): Implement action.
148 (event_accessors_declaration): Implement
149 (variable_declarators): swap statements for first rule - trivial.
151 * class.cs (Event): New class to hold information about event
153 (TypeContainer::AddEvent): New method to add an event to a type
154 (TypeContainer::events): New member to hold list of events.
156 * cs-parser.jay (event_declaration): Implement actions.
158 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
160 * cs-parser.jay (dim_separators): Implement. Make it a string
161 concatenating all the commas together, just as they appear.
162 (opt_dim_separators): Modify accordingly
163 (rank_specifiers): Update accordingly. Basically do the same
164 thing - instead, collect the brackets here.
165 (opt_rank_sepcifiers): Modify accordingly.
166 (array_type): Modify to actually return the complete type string
167 instead of ignoring the rank_specifiers.
168 (expression_list): Implement to collect the expressions
169 (variable_initializer): Implement. We make it a list of expressions
170 essentially so that we can handle the array_initializer case neatly too.
171 (variable_initializer_list): Implement.
172 (array_initializer): Make it a list of variable_initializers
173 (opt_array_initializer): Modify accordingly.
175 * expression.cs (New::NType): Add enumeration to help us
176 keep track of whether we have an object/delegate creation
177 or an array creation.
178 (New:NewType, New::Rank, New::Indices, New::Initializers): New
179 members to hold data about array creation.
180 (New:New): Modify to update NewType
181 (New:New): New Overloaded contructor for the array creation
184 * cs-parser.jay (array_creation_expression): Implement to call
185 the overloaded New constructor.
187 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
189 * class.cs (TypeContainer::Constructors): Return member
190 constructors instead of returning null.
192 2001-08-26 Miguel de Icaza <miguel@ximian.com>
194 * typemanager.cs (InitCoreTypes): Initialize the various core
195 types after we have populated the type manager with the user
196 defined types (this distinction will be important later while
197 compiling corlib.dll)
199 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
200 on Expression Classification. Now all expressions have a method
201 `Resolve' and a method `Emit'.
203 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
204 generation from working. Also add some temporary debugging
207 2001-08-24 Miguel de Icaza <miguel@ximian.com>
209 * codegen.cs: Lots of code generation pieces. This is only the
210 beginning, will continue tomorrow with more touches of polish. We
211 handle the fundamentals of if, while, do, for, return. Others are
212 trickier and I need to start working on invocations soon.
214 * gen-treedump.cs: Bug fix, use s.Increment here instead of
217 * codegen.cs (EmitContext): New struct, used during code
218 emission to keep a context. Most of the code generation will be
221 * cs-parser.jay: Add embedded blocks to the list of statements of
222 this block. So code generation proceeds in a top down fashion.
224 2001-08-23 Miguel de Icaza <miguel@ximian.com>
226 * statement.cs: Add support for multiple child blocks.
228 2001-08-22 Miguel de Icaza <miguel@ximian.com>
230 * codegen.cs (EmitCode): New function, will emit the code for a
231 Block of code given a TypeContainer and its ILGenerator.
233 * statement.cs (Block): Standard public readonly optimization.
234 (Block::Block constructors): Link children.
235 (Block::Child): Child Linker.
236 (Block::EmitVariables): Emits IL variable declarations.
238 * class.cs: Drop support for MethodGroups here, delay until
240 (Method::): Applied the same simplification that I did before, and
241 move from Properties to public readonly fields.
242 (Method::ParameterTypes): Returns the parameter types for the
243 function, and implements a cache that will be useful later when I
244 do error checking and the semantic analysis on the methods is
246 (Constructor::GetCallingConvention): Renamed from CallingConvetion
247 and made a method, optional argument tells whether this is a class
248 or a structure to apply the `has-this' bit.
249 (Method::GetCallingConvention): Implement, returns the calling
251 (Method::Define): Defines the type, a second pass is performed
252 later to populate the methods.
254 (Constructor::ParameterTypes): implement a cache similar to the
255 one on Method::ParameterTypes, useful later when we do semantic
258 (TypeContainer::EmitMethod): New method. Emits methods.
260 * expression.cs: Removed MethodGroup class from here.
262 * parameter.cs (Parameters::GetCallingConvention): new method.
264 2001-08-21 Miguel de Icaza <miguel@ximian.com>
266 * class.cs (TypeContainer::Populate): Drop RootContext from the
269 (Constructor::CallingConvention): Returns the calling convention.
270 (Constructor::ParameterTypes): Returns the constructor parameter
273 (TypeContainer::AddConstructor): Keep track of default constructor
274 and the default static constructor.
276 (Constructor::) Another class that starts using `public readonly'
277 instead of properties.
279 (Constructor::IsDefault): Whether this is a default constructor.
281 (Field::) use readonly public fields instead of properties also.
283 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
284 track of static constructors; If none is used, turn on
285 BeforeFieldInit in the TypeAttributes.
287 * cs-parser.jay (opt_argument_list): now the return can be null
288 for the cases where there are no arguments.
290 (constructor_declarator): If there is no implicit `base' or
291 `this', then invoke the default parent constructor.
293 * modifiers.cs (MethodAttr): New static function maps a set of
294 modifiers flags into a MethodAttributes enum
295 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
296 MethodAttr, TypeAttr to represent the various mappings where the
298 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
300 2001-08-19 Miguel de Icaza <miguel@ximian.com>
302 * parameter.cs (GetParameterInfo): Fix bug where there would be no
305 * interface.cs (PopulateIndexer): Implemented the code generator
306 for interface indexers.
308 2001-08-17 Miguel de Icaza <miguel@ximian.com>
310 * interface.cs (InterfaceMemberBase): Now we track the new status
313 (PopulateProperty): Implement property population. Woohoo! Got
314 Methods and Properties going today.
316 Removed all the properties for interfaces, and replaced them with
317 `public readonly' fields.
319 2001-08-16 Miguel de Icaza <miguel@ximian.com>
321 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
322 initialize their hashtables/arraylists only when they are needed
323 instead of doing this always.
325 * parameter.cs: Handle refs and out parameters.
327 * cs-parser.jay: Use an ArrayList to construct the arguments
328 instead of the ParameterCollection, and then cast that to a
331 * parameter.cs: Drop the use of ParameterCollection and use
332 instead arrays of Parameters.
334 (GetParameterInfo): Use the Type, not the Name when resolving
337 2001-08-13 Miguel de Icaza <miguel@ximian.com>
339 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
340 and instead use public readonly fields.
342 * class.cs: Put back walking code for type containers.
344 2001-08-11 Miguel de Icaza <miguel@ximian.com>
346 * class.cs (MakeConstant): Code to define constants.
348 * rootcontext.cs (LookupType): New function. Used to locate types
351 2001-08-08 Miguel de Icaza <miguel@ximian.com>
353 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
354 this System.Reflection code is. Kudos to Microsoft
356 * typemanager.cs: Implement a type cache and avoid loading all
357 types at boot time. Wrap in LookupType the internals. This made
358 the compiler so much faster. Wow. I rule!
360 * driver.cs: Make sure we always load mscorlib first (for
361 debugging purposes, nothing really important).
363 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
364 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
366 * rootcontext.cs: Lookup types on their namespace; Lookup types
367 on namespaces that have been imported using the `using' keyword.
369 * class.cs (TypeContainer::TypeAttr): Virtualize.
370 (Class::TypeAttr): Return attributes suitable for this bad boy.
371 (Struct::TypeAttr): ditto.
372 Handle nested classes.
373 (TypeContainer::) Remove all the type visiting code, it is now
374 replaced with the rootcontext.cs code
376 * rootcontext.cs (GetClassBases): Added support for structs.
378 2001-08-06 Miguel de Icaza <miguel@ximian.com>
380 * interface.cs, statement.cs, class.cs, parameter.cs,
381 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
382 Drop use of TypeRefs, and use strings instead.
384 2001-08-04 Miguel de Icaza <miguel@ximian.com>
388 * class.cs (Struct::Struct): set the SEALED flags after
389 checking the modifiers.
390 (TypeContainer::TypeAttr): new property, returns the
391 TypeAttributes for a class.
393 * cs-parser.jay (type_list): Oops, list production was creating a
394 new list of base types.
396 * rootcontext.cs (StdLib): New property.
397 (GetInterfaceTypeByName): returns an interface by type name, and
398 encapsulates error handling here.
399 (GetInterfaces): simplified.
400 (ResolveTree): Encapsulated all the tree resolution here.
401 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
404 * driver.cs: Add support for --nostdlib, to avoid loading the
406 (Main): Do not put tree resolution here.
408 * rootcontext.cs: Beginning of the class resolution.
410 2001-08-03 Miguel de Icaza <miguel@ximian.com>
412 * rootcontext.cs: Provide better error reporting.
414 * cs-parser.jay (interface_base): set our $$ to be interfaces.
416 * rootcontext.cs (CreateInterface): Handle the case where there
417 are no parent interfaces.
419 (CloseTypes): Routine to flush types at the end.
420 (CreateInterface): Track types.
421 (GetInterfaces): Returns an array of Types from the list of
424 * typemanager.c (AddUserType): Mechanism to track user types (puts
425 the type on the global type hash, and allows us to close it at the
428 2001-08-02 Miguel de Icaza <miguel@ximian.com>
430 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
431 RecordInterface instead.
433 * cs-parser.jay: Updated to reflect changes above.
435 * decl.cs (Definition): Keep track of the TypeBuilder type that
436 represents this type here. Not sure we will use it in the long
437 run, but wont hurt for now.
439 * driver.cs: Smaller changes to accomodate the new code.
441 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
444 * rootcontext.cs (CreateInterface): New method, used to create
445 the System.TypeBuilder type for interfaces.
446 (ResolveInterfaces): new entry point to resolve the interface
448 (CodeGen): Property, used to keep track of the code generator.
450 2001-07-26 Miguel de Icaza <miguel@ximian.com>
452 * cs-parser.jay: Add a second production for delegate_declaration
455 (enum_body): Put an opt_comma here instead of putting it on
456 enum_body or enum_member_declarations so we can handle trailing
457 commas on enumeration members. Gets rid of a shift/reduce.
459 (type_list): Need a COMMA in the middle.
461 (indexer_declaration): Tell tokenizer to recognize get/set
463 * Remove old targets.
465 * Re-add the parser target.
467 2001-07-13 Simon Cozens <simon@simon-cozens.org>
469 * cs-parser.jay: Add precendence rules for a number of operators
470 ot reduce the number of shift/reduce conflicts in the grammar.
472 2001-07-17 Miguel de Icaza <miguel@ximian.com>
474 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
477 Get rid of old crufty code.
479 * rootcontext.cs: Use this to keep track of the parsed
480 representation and the defined types available to the program.
482 * gen-treedump.cs: adjust for new convention.
484 * type.cs: Split out the type manager, and the assembly builder
487 * typemanager.cs: the type manager will live here now.
489 * cil-codegen.cs: And the code generator here.
491 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
493 * makefile: Fixed up for easy making.
495 2001-07-13 Simon Cozens <simon@simon-cozens.org>
497 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
500 (unary_expression): Expand pre_increment_expression and
501 post_decrement_expression to reduce a shift/reduce.
503 2001-07-11 Simon Cozens
505 * cs-tokenizer.cs: Hex numbers should begin with a 0.
507 Improve allow_keyword_as_indent name.
509 2001-06-19 Miguel de Icaza <miguel@ximian.com>
511 * Adjustments for Beta2.
513 2001-06-13 Miguel de Icaza <miguel@ximian.com>
515 * decl.cs: Added `Define' abstract method.
516 (InTransit): new property, used to catch recursive definitions.
518 * interface.cs: Implement `Define'.
520 * modifiers.cs: Map Modifiers.constants to
521 System.Reflection.TypeAttribute flags.
523 * class.cs: Keep track of types and user-defined types.
524 (BuilderInit): New method for creating an assembly
525 (ResolveType): New function to launch the resolution process, only
526 used by interfaces for now.
528 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
529 that are inserted into the name space.
531 2001-06-08 Miguel de Icaza <miguel@ximian.com>
533 * ARGH. I have screwed up my tree so many times due to the use of
534 rsync rather than using CVS. Going to fix this at once.
536 * driver.cs: Objetify driver. Load assemblies, use assemblies to
539 2001-06-07 Miguel de Icaza <miguel@ximian.com>
541 * Experiment successful: Use System.Type rather that our own
544 2001-05-25 Miguel de Icaza <miguel@ximian.com>
546 * cs-parser.jay: Removed nsAliases from here.
548 Use new namespaces, handle `using XXX;'
550 * namespace.cs: Reimplemented namespace handling, use a recursive
551 definition of the class. Now we can keep track of using clauses
552 and catch invalid using clauses.
554 2001-05-24 Miguel de Icaza <miguel@ximian.com>
556 * gen-treedump.cs: Adapted for all the renaming.
558 * expression.cs (Expression): this class now has a Type property
559 which returns an expression Type.
561 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
562 `Type', as this has a different meaning now in the base
564 2001-05-22 Miguel de Icaza <miguel@ximian.com>
566 * interface.cs, class.cs: Removed from all the sources the
567 references to signature computation, as we can not do method
568 signature computation during the parsing time, as we are not
569 trying to solve at that point distinguishing:
573 void a (NS.Blah x) {}
576 Which depending on the context might be valid or not, as we do not
577 know if Blah is the same thing as NS.Blah at that point.
579 * Redid everything so the code uses TypeRefs now instead of
580 Types. TypeRefs are just temporary type placeholders, that need
581 to be resolved. They initially have a pointer to a string and the
582 current scope in which they are used. This is used later by the
583 compiler to resolve the reference to an actual Type.
585 * DeclSpace is no longer a CIR.Type, and neither are
586 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
587 are all DeclSpaces, but no Types.
589 * type.cs (TypeRefManager): This implements the TypeRef manager,
590 which keeps track of all the types that need to be resolved after
591 the parsing has finished.
593 2001-05-13 Miguel de Icaza <miguel@ximian.com>
595 * ARGH. We are going to have to store `foreach' as a class rather
596 than resolving it, as we need to verify error 1579 after name
597 resolution. *OR* we could keep a flag that says `This request to
598 IEnumerator comes from a foreach statement' which we can then use
599 to generate the error.
601 2001-05-10 Miguel de Icaza <miguel@ximian.com>
603 * class.cs (TypeContainer.AddMethod): we now add methods to the
604 MethodGroup instead of the method hashtable.
606 * expression.cs: Add MethodGroup abstraction, which gets us one
607 step closer to the specification in the way we handle method
610 * cs-parser.jay (primary_expression): qualified_identifier now
611 tried to match up an identifier to a local variable reference or
612 to a parameter reference.
614 current_local_parameters is now a parser global variable that
615 points to the current parameters for the block, used during name
618 (property_declaration): Now creates an implicit `value' argument to
621 2001-05-09 Miguel de Icaza <miguel@ximian.com>
623 * parameter.cs: Do not use `param' arguments as part of the
624 signature, per the spec.
626 2001-05-08 Miguel de Icaza <miguel@ximian.com>
628 * decl.cs: Base class for classes, structs and interfaces. This
629 is the "Declaration Space"
631 * cs-parser.jay: Use CheckDef for checking declaration errors
632 instead of having one on each function.
634 * class.cs: Factor out some code for handling error handling in
635 accordance to the "Declarations" section in the "Basic Concepts"
636 chapter in the ECMA C# spec.
638 * interface.cs: Make all interface member classes derive from
641 2001-05-07 Miguel de Icaza <miguel@ximian.com>
643 * Many things: all interfaces are parsed and generated in
644 gen-treedump. Support for member variables, constructors,
645 destructors, properties, constants is there.
647 Beginning of the IL backend, but very little done, just there for
650 2001-04-29 Miguel de Icaza <miguel@ximian.com>
652 * cs-parser.jay: Fix labeled statement.
654 * cs-tokenizer.cs (escape): Escape " and ' always.
655 ref_line, ref_name: keep track of the line/filename as instructed
656 by #line by the compiler.
659 2001-04-27 Miguel de Icaza <miguel@ximian.com>
661 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
662 to match the values in System.CodeDOM.
664 Divid renamed to Divide.
666 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
668 (Statements.set): remove.
670 * System.CodeDOM/CodeCatchClause.cs: always have a valid
673 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
674 falseStatements always have valid values.
676 * cs-parser.jay: Use System.CodeDOM now.