1 2001-10-14 Miguel de Icaza <miguel@ximian.com>
3 * expression.cs: LocalTemporary: a new expression used to
4 reference a temporary that has been created.
6 * assign.cs: Handle PropertyAccess back here, so that we can
7 provide the proper semantic access to properties.
9 * expression.cs (Expression::ConvertReferenceExplicit): Implement
10 a few more explicit conversions.
12 * modifiers.cs: `NEW' modifier maps to HideBySig.
14 * expression.cs (PropertyExpr): Make this into an
15 ExpressionStatement, and support the EmitStatement code path.
17 Perform get/set error checking, clean up the interface.
19 * assign.cs: recognize PropertyExprs as targets, and if so, turn
20 them into toplevel access objects.
22 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24 * expression.cs: PropertyExpr::PropertyExpr: use work around the
27 * typemanager.cs: Keep track here of our PropertyBuilders again to
28 work around lameness in SRE.
30 2001-10-11 Miguel de Icaza <miguel@ximian.com>
32 * expression.cs (LValue::LValueResolve): New method in the
33 interface, used to perform a second resolution pass for LValues.
35 (This::DoResolve): Catch the use of this in static methods.
37 (This::LValueResolve): Implement.
39 (This::Store): Remove warning, assigning to `this' in structures
42 (Invocation::Emit): Deal with invocation of
43 methods on value types. We need to pass the address to structure
44 methods rather than the object itself. (The equivalent code to
45 emit "this" for structures leaves the entire structure on the
46 stack instead of a pointer to it).
48 (ParameterReference::DoResolve): Compute the real index for the
49 argument based on whether the method takes or not a `this' pointer
50 (ie, the method is static).
52 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
53 value types returned from functions when we need to invoke a
54 method on the sturcture.
57 2001-10-11 Ravi Pratap <ravi@ximian.com>
59 * class.cs (TypeContainer::DefineType): Method to actually do the business of
60 defining the type in the Modulebuilder or Typebuilder. This is to take
61 care of nested types which need to be defined on the TypeBuilder using
64 (TypeContainer::GetClassBases): Implement. Essentially the code from the
65 methods in RootContext, only ported to be part of TypeContainer.
67 (TypeContainer::GetInterfaceOrClass): Ditto.
69 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
71 * interface.cs (Interface::DefineInterface): New method. Does exactly
72 what RootContext.CreateInterface did earlier, only it takes care of nested types
75 (Interface::GetInterfaces): Move from RootContext here and port.
77 (Interface::GetInterfaceByName): Same here.
79 * rootcontext.cs (ResolveTree): Re-write.
81 (PopulateTypes): Re-write.
83 * class.cs (TypeContainer::Populate): Populate nested types too.
84 (TypeContainer::Emit): Emit nested members too.
86 * typemanager.cs (AddUserType): Do not make use of the FullName property,
87 instead just use the name argument passed in as it is already fully
90 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
91 to TypeContainer mapping to see if a type is user-defined.
93 * class.cs (TypeContainer::CloseType): Implement.
95 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
96 the default constructor.
98 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
101 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
103 * interface.cs (CloseType): Create the type here.
105 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
108 Remove all the methods which are now in TypeContainer.
110 2001-10-10 Ravi Pratap <ravi@ximian.com>
112 * delegate.cs (Define): Re-write bits to define the delegate
115 2001-10-10 Miguel de Icaza <miguel@ximian.com>
117 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
119 * expression.cs (ImplicitReferenceConversion): handle null as well
120 as a source to convert to any reference type.
122 * statement.cs (Return): Perform any implicit conversions to
123 expected return type.
125 Validate use of return statement.
127 * codegen.cs (EmitContext): Pass the expected return type here.
129 * class.cs (Method, Constructor, Property): Pass expected return
132 2001-10-09 Miguel de Icaza <miguel@ximian.com>
134 * expression.cs: Make DoResolve take an EmitContext instead of a
137 Replaced `l' and `location' for `loc', for consistency.
139 (Error, Warning): Remove unneeded Tc argument.
141 * assign.cs, literal.cs, constant.cs: Update to new calling
144 * codegen.cs: EmitContext now contains a flag indicating whether
145 code is being generated in a static method or not.
147 * cs-parser.jay: DecomposeQI, new function that replaces the old
148 QualifiedIdentifier. Now we always decompose the assembled
149 strings from qualified_identifier productions into a group of
152 2001-10-08 Miguel de Icaza <miguel@ximian.com>
154 * rootcontext.cs: Deal with field-less struct types correctly now
155 by passing the size option to Define Type.
157 * class.cs: Removed hack that created one static field.
159 2001-10-07 Miguel de Icaza <miguel@ximian.com>
161 * statement.cs: Moved most of the code generation here.
163 2001-10-09 Ravi Pratap <ravi@ximian.com>
165 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
168 (ElementAccess): Remove useless bits for now - keep checks as the spec
171 2001-10-08 Ravi Pratap <ravi@ximian.com>
173 * expression.cs (ElementAccess::DoResolve): Remove my crap code
174 and start performing checks according to the spec.
176 2001-10-07 Ravi Pratap <ravi@ximian.com>
178 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
179 rank_specifiers instead.
181 (rank_specifiers): Change the order in which the rank specifiers are stored
183 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
185 * expression.cs (ElementAccess): Implement the LValue interface too.
187 2001-10-06 Ravi Pratap <ravi@ximian.com>
189 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
190 except that user defined conversions are not included.
192 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
193 perform the conversion of the return type, if necessary.
195 (New::DoResolve): Check whether we are creating an array or an object
196 and accordingly do the needful.
198 (New::Emit): Same here.
200 (New::DoResolve): Implement guts of array creation.
202 (New::FormLookupType): Helper function.
204 2001-10-07 Miguel de Icaza <miguel@ximian.com>
206 * codegen.cs: Removed most of the code generation here, and move the
207 corresponding code generation bits to the statement classes.
209 Added support for try/catch/finalize and throw.
211 * cs-parser.jay: Added support for try/catch/finalize.
213 * class.cs: Catch static methods having the flags override,
216 * expression.cs (UserCast): This user cast was not really doing
217 what it was supposed to do. Which is to be born in fully resolved
218 state. Parts of the resolution were being performed at Emit time!
222 2001-10-05 Miguel de Icaza <miguel@ximian.com>
224 * expression.cs: Implicity convert the result from UserCast.
226 2001-10-05 Ravi Pratap <ravi@ximian.com>
228 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
229 prevented it from working correctly.
231 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
232 merely ConvertImplicit.
234 2001-10-05 Miguel de Icaza <miguel@ximian.com>
236 * typemanager.cs: Make the LookupTypeContainer function static,
237 and not per-instance.
239 * class.cs: Make static FindMembers (the one that takes a Type
242 * codegen.cs: Add EmitForeach here.
244 * cs-parser.jay: Make foreach a toplevel object instead of the
245 inline expansion, as we need to perform semantic analysis on it.
247 2001-10-05 Ravi Pratap <ravi@ximian.com>
249 * expression.cs (Expression::ImplicitUserConversion): Rename to
250 UserDefinedConversion.
252 (Expression::UserDefinedConversion): Take an extra argument specifying
253 whether we look for explicit user conversions too.
255 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
257 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
259 (ExplicitUserConversion): Make it a call to UserDefinedConversion
260 with the appropriate arguments.
262 * cs-parser.jay (cast_expression): Record location too.
264 * expression.cs (Cast): Record location info.
266 (Expression::ConvertExplicit): Take location argument.
268 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
269 to determine if we are doing explicit conversions.
271 (UserCast::Emit): Update accordingly.
273 (Expression::ConvertExplicit): Report an error if everything fails.
275 * ../errors/cs0030.cs : Add.
277 2001-10-04 Miguel de Icaza <miguel@ximian.com>
279 * modifiers.cs: If the ABSTRACT keyword is present, also set the
280 virtual and newslot bits.
282 * class.cs (TypeContainer::RegisterRequiredImplementations):
283 Record methods we need.
285 (TypeContainer::MakeKey): Helper function to make keys for
286 MethodBases, since the Methodbase key is useless.
288 (TypeContainer::Populate): Call RegisterRequiredImplementations
289 before defining the methods.
291 Create a mapping for method_builders_to_methods ahead of time
292 instead of inside a tight loop.
294 (::RequireMethods): Accept an object as the data to set into the
295 hashtable so we can report interface vs abstract method mismatch.
297 2001-10-03 Miguel de Icaza <miguel@ximian.com>
299 * report.cs: Make all of it static.
301 * rootcontext.cs: Drop object_type and value_type computations, as
302 we have those in the TypeManager anyways.
304 Drop report instance variable too, now it is a global.
306 * driver.cs: Use try/catch on command line handling.
308 Add --probe option to debug the error reporting system with a test
311 * report.cs: Add support for exiting program when a probe
312 condition is reached.
314 2001-10-03 Ravi Pratap <ravi@ximian.com>
316 * expression.cs (Binary::DoNumericPromotions): Fix the case when
317 we do a forcible conversion regardless of type, to check if
318 ForceConversion returns a null.
320 (Binary::error19): Use location to report error.
322 (Unary::error23): Use location here too.
324 * ../errors/cs0019.cs : Check in.
326 * ../errors/cs0023.cs : Check in.
328 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
329 case of a non-null MethodInfo object with a length of 0 !
331 (Binary::ResolveOperator): Flag error if overload resolution fails to find
332 an applicable member - according to the spec :-)
333 Also fix logic to find members in base types.
335 (Unary::ResolveOperator): Same here.
337 (Unary::report23): Change name to error23 and make first argument a TypeContainer
338 as I was getting thoroughly confused between this and error19 :-)
340 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
341 (::FindMostEncompassedType): Implement.
342 (::FindMostEncompassingType): Implement.
343 (::StandardConversionExists): Implement.
345 (UserImplicitCast): Re-vamp. We now need info about most specific
346 source and target types so that we can do the necessary conversions.
348 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
349 mathematical union with no duplicates.
351 2001-10-03 Miguel de Icaza <miguel@ximian.com>
353 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
354 in order from base classes to child classes, so that we can in
355 child classes look up in our parent for method names and
356 attributes (required for handling abstract, virtual, new, override
357 constructs: we need to instrospect our base class, and if we dont
358 populate the classes in order, the introspection might be
359 incorrect. For example, a method could query its parent before
360 the parent has any methods and would determine that the parent has
361 no abstract methods (while it could have had them)).
363 (RootContext::CreateType): Record the order in which we define the
366 2001-10-02 Miguel de Icaza <miguel@ximian.com>
368 * class.cs (TypeContainer::Populate): Also method definitions can
369 fail now, keep track of this.
371 (TypeContainer::FindMembers): Implement support for
372 DeclaredOnly/noDeclaredOnly flag.
374 (Constructor::Emit) Return the ConstructorBuilder.
376 (Method::Emit) Return the MethodBuilder.
377 Check for abstract or virtual methods to be public.
379 * rootcontext.cs (RootContext::CreateType): Register all the
380 abstract methods required for the class to be complete and the
381 interface methods that must be implemented.
383 * cs-parser.jay: Report error 501 (method requires body if it is
384 not marked abstract or extern).
386 * expression.cs (TypeOf::Emit): Implement.
388 * typemanager.cs: runtime_handle_type, new global type.
390 * class.cs (Property::Emit): Generate code for properties.
392 2001-10-02 Ravi Pratap <ravi@ximian.com>
394 * expression.cs (Unary::ResolveOperator): Find operators on base type
395 too - we now conform exactly to the spec.
397 (Binary::ResolveOperator): Same here.
399 * class.cs (Operator::Define): Fix minor quirk in the tests.
401 * ../errors/cs0215.cs : Added.
403 * ../errors/cs0556.cs : Added.
405 * ../errors/cs0555.cs : Added.
407 2001-10-01 Miguel de Icaza <miguel@ximian.com>
409 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
410 single integer which is really efficient
412 2001-10-01 Ravi Pratap <ravi@ximian.com>
414 * expression.cs (Expression::ImplicitUserConversion): Use location
415 even in the case when we are examining True operators.
417 * class.cs (Operator::Define): Perform extensive checks to conform
418 with the rules for operator overloading in the spec.
420 * expression.cs (Expression::ImplicitReferenceConversion): Implement
421 some of the other conversions mentioned in the spec.
423 * typemanager.cs (array_type): New static member for the System.Array built-in
426 (cloneable_interface): For System.ICloneable interface.
428 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
429 we start resolving the tree and populating types.
431 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
433 2001-10-01 Miguel de Icaza <miguel@ximian.com>
435 * expression.cs (Expression::ExprClassFromMemberInfo,
436 Expression::Literalize): Create literal expressions from
437 FieldInfos which are literals.
439 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
440 type casts, because they were wrong. The test suite in tests
443 (ImplicitNumericConversion): ushort to ulong requires a widening
446 Int32 constant to long requires widening cast as well.
448 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
449 for integers because the type on the stack is not i4.
451 2001-09-30 Miguel de Icaza <miguel@ximian.com>
453 * expression.cs (report118): require location argument.
455 * parameter.cs: Do not dereference potential null value.
457 * class.cs: Catch methods that lack the `new' keyword when
458 overriding a name. Report warnings when `new' is used without
459 anything being there to override.
461 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
463 * class.cs: Only add constructor to hashtable if it is non-null
464 (as now constructors can fail on define).
466 (TypeManager, Class, Struct): Take location arguments.
468 Catch field instance initialization in structs as errors.
470 accepting_filter: a new filter for FindMembers that is static so
471 that we dont create an instance per invocation.
473 (Constructor::Define): Catch errors where a struct constructor is
476 * cs-parser.jay: Pass location information for various new
479 * delegate.cs (Delegate): take a location argument.
481 * driver.cs: Do not call EmitCode if there were problesm in the
482 Definition of the types, as many Builders wont be there.
484 * decl.cs (Decl::Decl): Require a location argument.
486 * cs-tokenizer.cs: Handle properly hex constants that can not fit
487 into integers, and find the most appropiate integer for it.
489 * literal.cs: Implement ULongLiteral.
491 * rootcontext.cs: Provide better information about the location of
492 failure when CreateType fails.
494 2001-09-29 Miguel de Icaza <miguel@ximian.com>
496 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
499 * expression.cs (Binary::CheckShiftArguments): Add missing type
501 (Binary::ResolveOperator): Add type to the logical and and logical
502 or, Bitwise And/Or and Exclusive Or code paths, it was missing
505 (Binary::DoNumericPromotions): In the case where either argument
506 is ulong (and most signed types combined with ulong cause an
507 error) perform implicit integer constant conversions as well.
509 2001-09-28 Miguel de Icaza <miguel@ximian.com>
511 * expression.cs (UserImplicitCast): Method should always be
513 (Invocation::BetterConversion): Simplified test for IntLiteral.
515 (Expression::ImplicitNumericConversion): Split this routine out.
516 Put the code that performs implicit constant integer conversions
519 (Expression::Resolve): Become a wrapper around DoResolve so we can
520 check eclass and type being set after resolve.
522 (Invocation::Badness): Remove this dead function
524 (Binary::ResolveOperator): Do not compute the expensive argumnets
525 unless we have a union for it.
527 (Probe::Emit): Is needs to do an isinst and then
528 compare against null.
530 (::CanConvert): Added Location argument. If the Location argument
531 is null (Location.Null), then we do not report errors. This is
532 used by the `probe' mechanism of the Explicit conversion. We do
533 not want to generate an error for something that the user
534 explicitly requested to be casted. But the pipeline for an
535 explicit cast first tests for potential implicit casts.
537 So for now, if the Location is null, it means `Probe only' to
538 avoid adding another argument. Might have to revise this
541 (ClassCast): New class used to type cast objects into arbitrary
542 classes (used in Explicit Reference Conversions).
544 Implement `as' as well.
546 Reverted all the patches from Ravi below: they were broken:
548 * The use of `level' as a mechanism to stop recursive
549 invocations is wrong. That was there just to catch the
550 bug with a strack trace but not as a way of addressing
553 To fix the problem we have to *understand* what is going
554 on and the interactions and come up with a plan, not
555 just get things going.
557 * The use of the type conversion cache that I proposed
558 last night had an open topic: How does this work across
559 protection domains. A user defined conversion might not
560 be public in the location where we are applying the
561 conversion, a different conversion might be selected
562 (ie, private A->B (better) but public B->A (worse),
563 inside A, A->B applies, but outside it, B->A will
566 * On top of that (ie, even if the above is solved),
567 conversions in a cache need to be abstract. Ie, `To
568 convert from an Int to a Short use an OpcodeCast', not
569 `To convert from an Int to a Short use the OpcodeCast on
570 the variable 5' (which is what this patch was doing).
572 2001-09-28 Ravi Pratap <ravi@ximian.com>
574 * expression.cs (Invocation::ConversionExists): Re-write to use
577 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
578 cache all conversions done, not just user-defined ones.
580 (Invocation::BetterConversion): The real culprit. Use ConversionExists
581 to determine if a conversion exists instead of acutually trying to
582 perform the conversion. It's faster too.
584 (Expression::ConvertExplicit): Modify to use ConversionExists to check
585 and only then attempt the implicit conversion.
587 2001-09-28 Ravi Pratap <ravi@ximian.com>
589 * expression.cs (ConvertImplicit): Use a cache for conversions
590 already found. Check level of recursion and bail out if necessary.
592 2001-09-28 Miguel de Icaza <miguel@ximian.com>
594 * typemanager.cs (string_concat_string_string, string_concat_object_object):
595 Export standard methods that we expect for string operations.
597 * statement.cs (Block::UsageWarning): Track usage of variables and
598 report the errors for not used variables.
600 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
603 2001-09-27 Miguel de Icaza <miguel@ximian.com>
605 * codegen.cs: remove unnneded code
607 * expression.cs: Removed BuiltinTypeAccess class
609 Fix the order in which implicit conversions are
612 The previous fixed dropped support for boxed conversions (adding a
613 test to the test suite now)
615 (UserImplicitCast::CanConvert): Remove test for source being null,
616 that code is broken. We should not feed a null to begin with, if
617 we do, then we should track the bug where the problem originates
618 and not try to cover it up here.
620 Return a resolved expression of type UserImplicitCast on success
621 rather than true/false. Ravi: this is what I was talking about,
622 the pattern is to use a static method as a "constructor" for
625 Also, do not create arguments until the very last minute,
626 otherwise we always create the arguments even for lookups that
627 will never be performed.
629 (UserImplicitCast::Resolve): Eliminate, objects of type
630 UserImplicitCast are born in a fully resolved state.
632 * typemanager.cs (InitCoreTypes): Init also value_type
635 * expression.cs (Cast::Resolve): First resolve the child expression.
637 (LValue): Add new method AddressOf to be used by
640 Change the argument of Store to take an EmitContext instead of an
641 ILGenerator, because things like FieldExpr need to be able to call
642 their children expression to generate the instance code.
644 (Expression::Error, Expression::Warning): Sugar functions for
647 (Expression::MemberLookup): Accept a TypeContainer instead of a
648 Report as the first argument.
650 (Expression::ResolvePrimary): Killed. I still want to improve
651 this as currently the code is just not right.
653 (Expression::ResolveMemberAccess): Simplify, but it is still
656 (Unary::Resolve): Catch errors in AddressOf operators.
658 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
659 index to a byte for the short-version, or the compiler will choose
660 the wrong Emit call, which generates the wrong data.
662 (ParameterReference::Emit, ::Store): same.
664 (FieldExpr::AddressOf): Implement.
666 * typemanager.cs: TypeManager: made public variable instead of
669 * driver.cs: document --fatal.
671 * report.cs (ErrorMessage, WarningMessage): new names for the old
672 Error and Warning classes.
674 * cs-parser.jay (member_access): Turn built-in access to types
675 into a normal simplename
677 2001-09-27 Ravi Pratap <ravi@ximian.com>
679 * expression.cs (Invocation::BetterConversion): Fix to cope
680 with q being null, since this was introducing a bug.
682 * expression.cs (ConvertImplicit): Do built-in conversions first.
684 2001-09-27 Ravi Pratap <ravi@ximian.com>
686 * expression.cs (UserImplicitCast::Resolve): Fix bug.
688 2001-09-27 Ravi Pratap <ravi@ximian.com>
690 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
691 I had introduced long ago (what's new ?).
693 * expression.cs (UserImplicitCast::CanConvert): Static method to do
694 the work of all the checking.
695 (ConvertImplicit): Call CanConvert and only then create object if necessary.
696 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
698 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
699 that is the right way.
701 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
702 overloading resolution. Use everywhere instead of cutting and pasting code.
704 (Binary::ResolveOperator): Use MakeUnionSet.
706 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
707 we have to convert to bool types. Not complete yet.
709 2001-09-27 Miguel de Icaza <miguel@ximian.com>
711 * typemanager.cs (TypeManager::CSharpName): support ushort.
713 * expression.cs (Expression::TryImplicitIntConversion): Attempts
714 to provide an expression that performsn an implicit constant int
715 conversion (section 6.1.6).
716 (Expression::ConvertImplicitRequired): Reworked to include
717 implicit constant expression conversions.
719 (Expression::ConvertNumericExplicit): Finished.
721 (Invocation::Emit): If InstanceExpression is null, then it means
722 that we perform a call on this.
724 2001-09-26 Miguel de Icaza <miguel@ximian.com>
726 * expression.cs (Unary::Emit): Remove some dead code.
727 (Probe): Implement Resolve and Emit for `is'.
728 (Expression::ConvertImplicitRequired): Attempt to do constant
729 expression conversions here. Maybe should be moved to
730 ConvertImplicit, but I am not sure.
731 (Expression::ImplicitLongConstantConversionPossible,
732 Expression::ImplicitIntConstantConversionPossible): New functions
733 that tell whether is it possible to apply an implicit constant
734 expression conversion.
736 (ConvertNumericExplicit): Started work on explicit numeric
739 * cs-parser.jay: Update operator constants.
741 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
742 (Parameters::GetSignature): Hook up VerifyArgs here.
743 (Parameters::VerifyArgs): Verifies that no two arguments have the
746 * class.cs (Operator): Update the operator names to reflect the
747 ones that the spec expects (as we are just stringizing the
750 * expression.cs (Unary::ResolveOperator): Fix bug: Use
751 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
752 previous usage did only work for our methods.
753 (Expression::ConvertImplicit): Handle decimal implicit numeric
755 (Expression::InternalTypeConstructor): Used to invoke constructors
756 on internal types for default promotions.
758 (Unary::Emit): Implement special handling for the pre/post
759 increment/decrement for overloaded operators, as they need to have
760 the same semantics as the other operators.
762 (Binary::ResolveOperator): ditto.
763 (Invocation::ConversionExists): ditto.
764 (UserImplicitCast::Resolve): ditto.
766 2001-09-26 Ravi Pratap <ravi@ximian.com>
768 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
769 operator, return after emitting body. Regression tests pass again !
771 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
772 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
773 (Invocation::OverloadResolve): Ditto.
774 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
776 * everywhere : update calls to the above methods accordingly.
778 2001-09-26 Miguel de Icaza <miguel@ximian.com>
780 * assign.cs (Assign): Make it inherit from ExpressionStatement.
782 * expression.cs (ExpressionStatement): New base class used for
783 expressions that can appear in statements, so that we can provide
784 an alternate path to generate expression that do not leave a value
787 (Expression::Emit, and all the derivatives): We no longer return
788 whether a value is left on the stack or not. Every expression
789 after being emitted leaves a single value on the stack.
791 * codegen.cs (EmitContext::EmitStatementExpression): Use the
792 facilties of ExpressionStatement if possible.
794 * cs-parser.jay: Update statement_expression.
796 2001-09-25 Miguel de Icaza <miguel@ximian.com>
798 * driver.cs: Change the wording of message
800 2001-09-25 Ravi Pratap <ravi@ximian.com>
802 * expression.cs (Binary::ResolveOperator): Had forgottten to set
803 the type of the expression to the return type of the method if
804 we have an overloaded operator match ! The regression tests pass again !
805 (Unary::ResolveOperator): Ditto.
807 * expression.cs (Invocation::ConversionExists): Correct the member lookup
808 to find "op_Implicit", not "implicit" ;-)
809 (UserImplicitCast): New class to take care of user-defined implicit conversions.
810 (ConvertImplicit, ForceConversion): Take TypeContainer argument
812 * everywhere : Correct calls to the above accordingly.
814 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
815 (ConvertImplicit): Do user-defined conversion if it exists.
817 2001-09-24 Miguel de Icaza <miguel@ximian.com>
819 * assign.cs: track location.
820 (Resolve): Use implicit conversions on assignment.
822 * literal.cs: Oops. Not good, Emit of short access values should
823 pass (Bytes) or the wrong argument will be selected.
825 * expression.cs (Unary::Emit): Emit code for -expr.
827 (Unary::ResolveOperator): Handle `Substract' for non-constants
828 (substract from zero from the non-constants).
829 Deal with Doubles as well.
831 (Expression::ConvertImplicitRequired): New routine that reports an
832 error if no implicit conversion exists.
834 (Invocation::OverloadResolve): Store the converted implicit
835 expressions if we make them
837 2001-09-24 Ravi Pratap <ravi@ximian.com>
839 * class.cs (ConstructorInitializer): Take a Location argument.
840 (ConstructorBaseInitializer): Same here.
841 (ConstructorThisInitializer): Same here.
843 * cs-parser.jay : Update all calls accordingly.
845 * expression.cs (Unary, Binary, New): Take location argument.
846 Update accordingly everywhere.
848 * cs-parser.jay : Update all calls to the above to take a location
853 2001-09-24 Ravi Pratap <ravi@ximian.com>
855 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
856 (Invocation::BetterConversion): Same here
857 (Invocation::ConversionExists): Ditto.
859 (Invocation::ConversionExists): Implement.
861 2001-09-22 Ravi Pratap <ravi@ximian.com>
863 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
864 Also take an additional TypeContainer argument.
866 * All over : Pass in TypeContainer as argument to OverloadResolve.
868 * typemanager.cs (CSharpName): Update to check for the string type and return
871 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
874 2001-09-21 Ravi Pratap <ravi@ximian.com>
876 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
877 (Invocation::BetterFunction): Implement.
878 (Invocation::BetterConversion): Implement.
879 (Invocation::ConversionExists): Skeleton, no implementation yet.
881 Okay, things work fine !
883 2001-09-21 Miguel de Icaza <miguel@ximian.com>
885 * typemanager.cs: declare and load enum_type, delegate_type and
888 * expression.cs (Expression::Emit): Now emit returns a value that
889 tells whether a value is left on the stack or not. This strategy
890 might be reveted tomorrow with a mechanism that would address
891 multiple assignments.
892 (Expression::report118): Utility routine to report mismatches on
895 (Unary::Report23): Report impossible type/operator combination
898 (Unary::IsIncrementableNumber): Whether the type can be
899 incremented or decremented with add.
900 (Unary::ResolveOperator): Also allow enumerations to be bitwise
902 (Unary::ResolveOperator): Implement ++, !, ~, ++ and --.
904 (Invocation::Emit): Deal with new Emit convetion.
906 * All Expression derivatives: Updated their Emit method to return
907 whether they leave values on the stack or not.
909 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
910 stack for expressions that are statements.
912 2001-09-20 Miguel de Icaza <miguel@ximian.com>
914 * expression.cs (LValue): New interface. Must be implemented by
916 (LocalVariableReference, ParameterReference, FieldExpr): Implement
919 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
920 interface for generating code, simplifies the code.
922 2001-09-20 Ravi Pratap <ravi@ximian.com>
924 * expression.cs (everywhere): Comment out return statements in ::Resolve
925 methods to avoid the warnings.
927 2001-09-20 Miguel de Icaza <miguel@ximian.com>
929 * driver.cs (parse): Report error 2001 if we can not open the
932 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
935 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
938 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
939 otherwise nested blocks end up with the same index.
941 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
943 * expression.cs: Instead of having FIXMEs in the Resolve
944 functions, throw exceptions so it is obvious that we are facing a
947 * cs-parser.jay (invocation_expression): Pass Location information.
949 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
950 Use a basename for those routines because .NET does not like paths
953 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
956 2001-09-19 Miguel de Icaza <miguel@ximian.com>
958 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
959 are loading the correct data types (throws an exception if not).
960 (TypeManager::InitCoreTypes): Use CoreLookupType
962 * expression.cs (Unary::ResolveOperator): return the child
963 expression for expressions which are just +expr.
964 (Unary::ResolveOperator): Return negative literals for -LITERAL
965 expressions (otherwise they are Unary {Literal}).
966 (Invocation::Badness): Take into account `Implicit constant
967 expression conversions'.
969 * literal.cs (LongLiteral): Implement long literal class.
970 (IntLiteral): export the `Value' of the intliteral.
972 2001-09-19 Ravi Pratap <ravi@ximian.com>
974 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
976 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
977 instead of 'Operator'
979 * expression.cs (Binary::ResolveOperator): Update accordingly.
980 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
983 * cs-parser.jay (unary_expression): Update to use the new names.
985 * gen-treedump.cs (GetUnary): Same here.
987 * expression.cs (Unary::Resolve): Implement.
988 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
989 operators are found instead of making noise ;-)
990 (Unary::ResolveOperator): New method to do precisely the same thing which
991 Binary::ResolveOperator does for Binary expressions.
992 (Unary.method, .Arguments): Add.
993 (Unary::OperName): Implement.
994 (Unary::ForceConversion): Copy and Paste !
996 * class.cs (Operator::Define): Fix a small bug for the case when we have
999 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
1000 for the inbuilt operators. Only overloading works for now ;-)
1002 2001-09-18 Miguel de Icaza <miguel@ximian.com>
1004 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
1005 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
1007 * expression.cs (This::Emit): Implement.
1008 (This::Resolve): Implement.
1009 (TypeOf:Resolve): Implement.
1010 (Expression::ResolveSimpleName): Add an implicit this to instance
1012 (MemberAccess::Resolve): Deal with Parameters and Fields.
1013 Bind instance variable to Field expressions.
1014 (FieldExpr::Instance): New field used to track the expression that
1015 represents the object instance.
1016 (FieldExpr::Resolve): Track potential errors from MemberLookup not
1018 (FieldExpr::Emit): Implement.
1020 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
1021 the last instruction contains a return opcode to avoid generating
1022 the last `ret' instruction (this generates correct code, and it is
1023 nice to pass the peverify output).
1025 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
1026 initializer for static and instance variables.
1027 (Constructor::Emit): Allow initializer to be null in the case of
1028 static constructors. Only emit initializer for instance
1031 (TypeContainer::FindMembers): Return a null array if there are no
1034 Also fix the code for the MemberTypes.Method branch, as it was not
1035 scanning that for operators (or tried to access null variables before).
1037 * assign.cs (Assign::Emit): Handle instance and static fields.
1041 * driver.cs: Stop compilation if there are parse errors.
1043 * cs-parser.jay (constructor_declaration): Provide default base
1044 initializer for non-static constructors.
1045 (constructor_declarator): Do not provide a default base
1046 initializers if none was specified.
1047 Catch the fact that constructors should not have parameters.
1049 * class.cs: Do not emit parent class initializers for static
1050 constructors, that should be flagged as an error.
1052 2001-09-18 Ravi Pratap <ravi@ximian.com>
1054 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
1055 Move back code into TypeContainer::Populate.
1057 2001-09-18 Ravi Pratap <ravi@ximian.com>
1059 * class.cs (TypeContainer::AddConstructor): Fix the check to
1060 compare against Name, not Basename.
1061 (Operator::OpType): Change Plus and Minus to Add and Subtract.
1063 * cs-parser.jay : Update accordingly.
1065 * class.cs (TypeContainer::FindMembers): For the case where we are searching
1066 for methods, don't forget to look into the operators too.
1067 (RegisterMethodBuilder): Helper method to take care of this for
1068 methods, constructors and operators.
1069 (Operator::Define): Completely revamp.
1070 (Operator.OperatorMethod, MethodName): New fields.
1071 (TypeContainer::Populate): Move the registering of builders into
1072 RegisterMethodBuilder.
1073 (Operator::Emit): Re-write.
1075 * expression.cs (Binary::Emit): Comment out code path to emit method
1076 invocation stuff for the case when we have a user defined operator. I am
1077 just not able to get it right !
1079 2001-09-17 Miguel de Icaza <miguel@ximian.com>
1081 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
1084 (Expression::MemberLookup): Provide a version that allows to
1085 specify the MemberTypes and BindingFlags.
1087 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
1088 so it was not fetching variable information from outer blocks.
1090 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
1091 Beforefieldinit as it was buggy.
1093 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
1096 * class.cs (Constructor::Emit): Only emit if block is not null.
1097 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
1098 deal with this by semantically definining it as if the user had
1101 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
1102 constructors as we now "emit" them at a higher level.
1104 (TypeContainer::DefineDefaultConstructor): Used to define the
1105 default constructors if none was provided.
1107 (ConstructorInitializer): Add methods Resolve and Emit.
1109 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
1111 2001-09-17 Ravi Pratap <ravi@ximian.com>
1113 * class.cs (TypeContainer::EmitDefaultConstructor): Register
1114 the default constructor builder with our hashtable for methodbuilders
1117 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
1118 and argument_count is 0 in which case we have a match.
1119 (Binary::ResolveOperator): More null checking and miscellaneous coding
1122 2001-09-17 Ravi Pratap <ravi@ximian.com>
1124 * rootcontext.cs (IsNameSpace): Compare against null.
1126 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
1128 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
1129 and Unary::Operator.
1131 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
1134 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
1135 we have overloaded operators.
1136 (Binary::ResolveOperator): Implement the part which does the operator overload
1139 * class.cs (Operator::Emit): Implement.
1140 (TypeContainer::Emit): Emit the operators we have too.
1142 * expression.cs (Binary::Emit): Update to emit the appropriate code for
1143 the case when we have a user-defined operator.
1145 2001-09-17 Miguel de Icaza <miguel@ximian.com>
1147 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
1149 2001-09-16 Ravi Pratap <ravi@ximian.com>
1151 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
1152 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
1153 (Constructor::Emit): Implement.
1154 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
1155 if we have no work to do.
1156 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
1159 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
1160 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
1162 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
1165 2001-09-15 Ravi Pratap <ravi@ximian.com>
1167 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
1169 (Tree::RecordNamespace): Method to do what the name says ;-)
1170 (Tree::Namespaces): Property to get at the namespaces hashtable.
1172 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
1175 * rootcontext.cs (IsNamespace): Fixed it :-)
1177 2001-09-14 Miguel de Icaza <miguel@ximian.com>
1179 * class.cs (TypeContainer::FindMembers): Add support for
1181 (MethodCore): New class that encapsulates both the shared aspects
1182 of a Constructor and a Method.
1183 (Method, Constructor): Factored pieces into MethodCore.
1185 * driver.cs: Added --fatal which makes errors throw exceptions.
1186 Load System assembly as well as part of the standard library.
1188 * report.cs: Allow throwing exceptions on errors for debugging.
1190 * modifiers.cs: Do not use `parent', instead use the real type
1191 container to evaluate permission settings.
1193 * class.cs: Put Ravi's patch back in. He is right, and we will
1194 have to cope with the
1196 2001-09-14 Ravi Pratap <ravi@ximian.com>
1198 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
1199 FamORAssem, not FamANDAssem.
1201 2001-09-14 Miguel de Icaza <miguel@ximian.com>
1203 * driver.cs: Added --parse option that only parses its input files
1206 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
1207 incorrect. IsTopLevel is not used to tell whether an object is
1208 root_types or not (that can be achieved by testing this ==
1209 root_types). But to see if this is a top-level *class* (not
1210 necessarly our "toplevel" container).
1212 2001-09-14 Ravi Pratap <ravi@ximian.com>
1214 * enum.cs (Enum::Define): Modify to call the Lookup method on the
1215 parent instead of a direct call to GetType.
1217 2001-09-14 Ravi Pratap <ravi@ximian.com>
1219 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
1220 Modifiers.TypeAttr. This should just be a call to that method.
1222 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
1223 object so that we can determine if we are top-level or not.
1225 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
1228 * enum.cs (Enum::Define): Ditto.
1230 * modifiers.cs (FieldAttr): Re-write.
1232 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
1233 (TypeContainer::HaveStaticConstructor): New property to provide access
1234 to precisely that info.
1236 * modifiers.cs (MethodAttr): Re-write.
1237 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
1239 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
1240 of top-level types as claimed.
1242 2001-09-13 Miguel de Icaza <miguel@ximian.com>
1244 * expression.cs (MemberLookup): Fruitless attempt to lookup
1245 constructors. Maybe I need to emit default constructors? That
1246 might be it (currently .NET emits this for me automatically).
1247 (Invocation::OverloadResolve): Cope with Arguments == null.
1248 (Invocation::EmitArguments): new function, shared by the new
1250 (Invocation::Emit): Handle static and instance methods. Emit
1251 proper call instruction for virtual or non-virtual invocations.
1252 (New::Emit): Implement.
1253 (New::Resolve): Implement.
1254 (MemberAccess:Resolve): Implement.
1255 (MethodGroupExpr::InstanceExpression): used conforming to the spec
1257 (FieldExpr::Resolve): Set type.
1259 * support.cs: Handle empty arguments.
1261 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
1262 SimpleLookup): Auxiliary routines to help parse a qualifier
1265 Update qualifier_identifier rule.
1267 * codegen.cs: Removed debugging messages.
1269 * class.cs: Make this a global thing, this acts just as a "key" to
1270 objects that we might have around.
1272 (Populate): Only initialize method_builders_to_methods once.
1274 * expression.cs (PropertyExpr): Initialize type from the
1277 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
1278 Resolve pattern. Attempt to implicitly convert value to boolean.
1281 * expression.cs: Set the type for the int32/int32 argument case.
1282 (Binary::ResolveOperator): Set the return type to boolean for
1283 comparission operators
1285 * typemanager.cs: Remove debugging print code.
1287 (Invocation::Resolve): resolve type.
1289 * class.cs: Allocate a MemberInfo of the correct size, as the code
1290 elsewhere depends on the test to reflect the correct contents.
1292 (Method::) Keep track of parameters, due to System.Reflection holes
1294 (TypeContainer::Populate): Keep track of MethodBuilders to Method
1297 (TypeContainer::FindMembers): Use ArrayList and then copy an array
1298 of the exact size and return that.
1300 (Class::LookupMethodByBuilder): New function that maps
1301 MethodBuilders to its methods. Required to locate the information
1302 on methods because System.Reflection bit us again.
1304 * support.cs: New file, contains an interface ParameterData and
1305 two implementations: ReflectionParameters and InternalParameters
1306 used to access Parameter information. We will need to grow this
1309 * expression.cs (Invocation::GetParameterData): implement a cache
1310 and a wrapper around the ParameterData creation for methods.
1311 (Invocation::OverloadResolve): Use new code.
1313 2001-09-13 Ravi Pratap <ravi@ximian.com>
1315 * class.cs (TypeContainer::EmitField): Remove and move into
1316 (Field::Define): here and modify accordingly.
1317 (Field.FieldBuilder): New member.
1318 (TypeContainer::Populate): Update accordingly.
1319 (TypeContainer::FindMembers): Implement.
1321 2001-09-13 Miguel de Icaza <miguel@ximian.com>
1323 * statement.cs: (VariableInfo::VariableType): New field to be
1324 initialized with the full type once it is resolved.
1326 2001-09-12 Miguel de Icaza <miguel@ximian.com>
1328 * parameter.cs (GetParameterInfo): Use a type cache to compute
1329 things only once, and to reuse this information
1331 * expression.cs (LocalVariableReference::Emit): Implement.
1332 (OpcodeCast::Emit): fix.
1334 (ParameterReference::Resolve): Implement.
1335 (ParameterReference::Emit): Implement.
1337 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
1338 that are expressions need to stay as Expressions.
1340 * typemanager.cs (CSharpName): Returns the C# name of a type if
1343 * expression.cs (Expression::ConvertImplicit): New function that
1344 implements implicit type conversions.
1346 (Expression::ImplicitReferenceConversion): Implements implicit
1347 reference conversions.
1349 (EmptyCast): New type for transparent casts.
1351 (OpcodeCast): New type for casts of types that are performed with
1352 a sequence of bytecodes.
1354 (BoxedCast): New type used for casting value types into reference
1355 types. Emits a box opcode.
1357 (Binary::DoNumericPromotions): Implements numeric promotions of
1358 and computation of the Binary::Type.
1360 (Binary::EmitBranchable): Optimization.
1362 (Binary::Emit): Implement code emission for expressions.
1364 * typemanager.cs (TypeManager): Added two new core types: sbyte
1367 2001-09-12 Ravi Pratap <ravi@ximian.com>
1369 * class.cs (TypeContainer::FindMembers): Method which does exactly
1370 what Type.FindMembers does, only we don't have to use reflection. No
1373 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
1374 typecontainer objects as we need to get at them.
1375 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
1377 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
1378 typecontainer object.
1380 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
1381 of just a Report object.
1383 2001-09-11 Ravi Pratap <ravi@ximian.com>
1385 * class.cs (Event::Define): Go back to using the prefixes "add_" and
1387 (TypeContainer::Populate): Now define the delegates of the type too.
1388 (TypeContainer.Delegates): Property to access the list of delegates defined
1391 * delegates.cs (Delegate::Define): Implement partially.
1393 * modifiers.cs (TypeAttr): Handle more flags.
1395 2001-09-11 Ravi Pratap <ravi@ximian.com>
1397 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
1399 (Operator::Define): Re-write logic to get types by using the LookupType method
1400 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
1401 (Indexer::Define): Ditto.
1402 (Event::Define): Ditto.
1403 (Property::Define): Ditto.
1405 2001-09-10 Ravi Pratap <ravi@ximian.com>
1407 * class.cs (TypeContainer::Populate): Now define operators too.
1408 (TypeContainer.Operators): New property to access the list of operators
1410 (Operator.OperatorMethodBuilder): New member to hold the method builder
1411 for the operator we are defining.
1412 (Operator::Define): Implement.
1414 2001-09-10 Ravi Pratap <ravi@ximian.com>
1416 * class.cs (Event::Define): Make the prefixes of the accessor methods
1417 addOn_ and removeOn_
1419 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
1420 of the location being passed in too. Ideally, this should go later since all
1421 error reporting should be done through the Report object.
1423 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
1424 (Populate): Iterate thru the indexers we have and define them too.
1425 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
1426 for the get and set accessors.
1427 (Indexer::Define): Implement.
1429 2001-09-09 Miguel de Icaza <miguel@ximian.com>
1431 * expression.cs (Binary::Resolve): Beginning of it. I scratched
1432 my previous implementation, did not work.
1434 * typemanager.cs: Add a couple of missing types (the longs).
1436 * literal.cs: Use TypeManager.bool_type instead of getting it.
1438 * expression.cs (EventExpr): New kind of expressions.
1439 (Expressio::ExprClassFromMemberInfo): finish
1441 2001-09-08 Miguel de Icaza <miguel@ximian.com>
1443 * assign.cs: Emit stores to static fields differently.
1445 2001-09-08 Ravi Pratap <ravi@ximian.com>
1447 * Merge in changes and adjust code to tackle conflicts. Backed out my
1448 code in Assign::Resolve ;-)
1450 2001-09-08 Ravi Pratap <ravi@ximian.com>
1452 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
1453 instead Report.Error and also pass in the location.
1454 (CSharpParser::Lexer): New readonly property to return the reference
1455 to the Tokenizer object.
1456 (declare_local_variables): Use Report.Error with location instead of plain
1460 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
1461 (Operator.CheckBinaryOperator): Ditto.
1463 * cs-parser.jay (operator_declarator): Update accordingly.
1465 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
1466 (CheckBinaryOperator): Same here.
1468 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
1469 on the name without any prefixes of namespace names etc. This is because we
1470 already might have something already fully qualified like
1471 'System.Console.WriteLine'
1473 * assign.cs (Resolve): Begin implementation. Stuck ;-)
1475 2001-09-07 Ravi Pratap <ravi@ximian.com>
1477 * cs-tokenizer.cs (location): Return a string which also contains
1480 * expression.cs (ElementAccess): New class for expressions of the
1481 type 'element access.'
1482 (BaseAccess): New class for expressions of the type 'base access.'
1483 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
1486 * cs-parser.jay (element_access): Implement action.
1487 (base_access): Implement actions.
1488 (checked_expression, unchecked_expression): Implement.
1490 * cs-parser.jay (local_variable_type): Correct and implement.
1491 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
1493 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
1495 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
1496 name and the specifiers.
1498 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
1500 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
1501 making them all public ;-)
1503 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
1506 2001-09-07 Miguel de Icaza <miguel@ximian.com>
1508 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
1510 (FieldExpr, PropertyExprs): New resolved expressions.
1511 (SimpleName::MemberStaticCheck): Perform static checks for access
1512 to non-static fields on static methods. Maybe this should be
1513 generalized for MemberAccesses.
1514 (SimpleName::ResolveSimpleName): More work on simple name
1517 * cs-parser.jay (primary_expression/qualified_identifier): track
1518 the parameter index.
1520 * codegen.cs (CodeGen::Save): Catch save exception, report error.
1521 (EmitContext::EmitBoolExpression): Chain to expression generation
1522 instead of temporary hack.
1523 (::EmitStatementExpression): Put generic expression code generation.
1525 * assign.cs (Assign::Emit): Implement variable assignments to
1526 local variables, parameters and fields.
1528 2001-09-06 Miguel de Icaza <miguel@ximian.com>
1530 * statement.cs (Block::GetVariableInfo): New method, returns the
1531 VariableInfo for a variable name in a block.
1532 (Block::GetVariableType): Implement in terms of GetVariableInfo
1534 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
1535 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
1537 2001-09-06 Ravi Pratap <ravi@ximian.com>
1539 * cs-parser.jay (operator_declaration): Continue on my quest : update
1540 to take attributes argument.
1541 (event_declaration): Ditto.
1542 (enum_declaration): Ditto.
1543 (indexer_declaration): Ditto.
1545 * class.cs (Operator::Operator): Update constructor accordingly.
1546 (Event::Event): Ditto.
1548 * delegate.cs (Delegate::Delegate): Same here.
1550 * enum.cs (Enum::Enum): Same here.
1552 2001-09-05 Ravi Pratap <ravi@ximian.com>
1554 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
1556 * ../tests/cs0658.cs : New file to demonstrate error 0658.
1558 * attribute.cs (Attributes): New class to encapsulate all attributes which were
1559 being passed around as an arraylist.
1560 (Attributes::AddAttribute): Method to add attribute sections.
1562 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
1563 (struct_declaration): Update accordingly.
1564 (constant_declaration): Update.
1565 (field_declaration): Update.
1566 (method_header): Update.
1567 (fixed_parameter): Update.
1568 (parameter_array): Ditto.
1569 (property_declaration): Ditto.
1570 (destructor_declaration): Ditto.
1572 * class.cs (Struct::Struct): Update constructors accordingly.
1573 (Class::Class): Ditto.
1574 (Field::Field): Ditto.
1575 (Method::Method): Ditto.
1576 (Property::Property): Ditto.
1577 (TypeContainer::OptAttribute): update property's return type.
1579 * interface.cs (Interface.opt_attributes): New member.
1580 (Interface::Interface): Update to take the extra Attributes argument.
1582 * parameter.cs (Parameter::Parameter): Ditto.
1584 * constant.cs (Constant::Constant): Ditto.
1586 * interface.cs (InterfaceMemberBase): New OptAttributes field.
1587 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
1588 the attributes as a parameter.
1589 (InterfaceProperty): Update constructor call.
1590 (InterfaceEvent): Ditto.
1591 (InterfaceMethod): Ditto.
1592 (InterfaceIndexer): Ditto.
1594 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
1595 pass the attributes too.
1596 (interface_event_declaration): Ditto.
1597 (interface_property_declaration): Ditto.
1598 (interface_method_declaration): Ditto.
1599 (interface_declaration): Ditto.
1601 2001-09-05 Miguel de Icaza <miguel@ximian.com>
1603 * class.cs (Method::Define): Track the "static Main" definition to
1604 create an entry point.
1606 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
1607 EntryPoint if we find it.
1609 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
1610 (EmitContext::ig): Make this variable public.
1612 * driver.cs: Make the default output file be the first file name
1613 with the .exe extension.
1615 Detect empty compilations
1617 Handle various kinds of output targets. Handle --target and
1618 rename -t to --dumper.
1620 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
1621 methods inherited from Expression return now an Expression. This
1622 will is used during the tree rewriting as we resolve them during
1625 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
1626 the spec. Missing entirely is the information about
1627 accessability of elements of it.
1629 (Expression::ExprClassFromMemberInfo): New constructor for
1630 Expressions that creates a fully initialized Expression based on
1631 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
1634 (Invocation::Resolve): Begin implementing resolution of invocations.
1636 * literal.cs (StringLiteral): Implement Emit.
1638 2001-09-05 Ravi Pratap <ravi@ximian.com>
1640 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
1643 2001-09-04 Ravi Pratap <ravi@ximian.com>
1645 * cs-parser.jay (attribute_arguments): Implement actions.
1646 (attribute): Fix bug in production. Implement action.
1647 (attribute_list): Implement.
1648 (attribute_target): Implement.
1649 (attribute_target_specifier, opt_target_specifier): Implement
1650 (CheckAttributeTarget): New method to check if the attribute target
1652 (attribute_section): Implement.
1653 (opt_attributes): Implement.
1655 * attribute.cs : New file to handle attributes.
1656 (Attribute): Class to hold attribute info.
1658 * cs-parser.jay (opt_attribute_target_specifier): Remove production
1659 (attribute_section): Modify production to use 2 different rules to
1660 achieve the same thing. 1 s/r conflict down !
1661 Clean out commented, useless, non-reducing dimension_separator rules.
1663 * class.cs (TypeContainer.attributes): New member to hold list
1664 of attributes for a type.
1665 (Struct::Struct): Modify to take one more argument, the attribute list.
1666 (Class::Class): Ditto.
1667 (Field::Field): Ditto.
1668 (Method::Method): Ditto.
1669 (Property::Property): Ditto.
1671 * cs-parser.jay (struct_declaration): Update constructor call to
1672 pass in the attributes too.
1673 (class_declaration): Ditto.
1674 (constant_declaration): Ditto.
1675 (field_declaration): Ditto.
1676 (method_header): Ditto.
1677 (fixed_parameter): Ditto.
1678 (parameter_array): Ditto.
1679 (property_declaration): Ditto.
1681 * constant.cs (Constant::Constant): Update constructor similarly.
1682 Use System.Collections.
1684 * parameter.cs (Parameter::Parameter): Update as above.
1686 2001-09-02 Ravi Pratap <ravi@ximian.com>
1688 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
1689 (TypeContainer.delegates): New member to hold list of delegates.
1691 * cs-parser.jay (delegate_declaration): Implement the action correctly
1692 this time as I seem to be on crack ;-)
1694 2001-09-02 Miguel de Icaza <miguel@ximian.com>
1696 * rootcontext.cs (RootContext::IsNamespace): new function, used to
1697 tell whether an identifier represents a namespace.
1699 * expression.cs (NamespaceExpr): A namespace expression, used only
1700 temporarly during expression resolution.
1701 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
1702 utility functions to resolve names on expressions.
1704 2001-09-01 Miguel de Icaza <miguel@ximian.com>
1706 * codegen.cs: Add hook for StatementExpressions.
1708 * class.cs: Fix inverted test for static flag in methods.
1710 2001-09-02 Ravi Pratap <ravi@ximian.com>
1712 * class.cs (Operator::CheckUnaryOperator): Correct error number used
1713 to make it coincide with MS' number.
1714 (Operator::CheckBinaryOperator): Ditto.
1716 * ../errors/errors.txt : Remove error numbers added earlier.
1718 * ../errors/cs1019.cs : Test case for error # 1019
1720 * ../errros/cs1020.cs : Test case for error # 1020
1722 * cs-parser.jay : Clean out commented cruft.
1723 (dimension_separators, dimension_separator): Comment out. Ostensibly not
1724 used anywhere - non-reducing rule.
1725 (namespace_declarations): Non-reducing rule - comment out.
1727 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
1728 with TypeContainer::AddEnum.
1730 * delegate.cs : New file for delegate handling classes.
1731 (Delegate): Class for declaring delegates.
1733 * makefile : Update.
1735 * cs-parser.jay (delegate_declaration): Implement.
1737 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
1739 * class.cs (Event::Define): Implement.
1740 (Event.EventBuilder): New member.
1742 * class.cs (TypeContainer::Populate): Update to define all enums and events
1744 (Events): New property for the events arraylist we hold. Shouldn't we move to using
1745 readonly fields for all these cases ?
1747 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
1749 * class.cs (Property): Revamp to use the convention of making fields readonly.
1750 Accordingly modify code elsewhere.
1752 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
1753 the Define method of the Property class.
1755 * class.cs : Clean up applied patch and update references to variables etc. Fix
1757 (TypeContainer::Populate): Update to define all the properties we have. Also
1758 define all enumerations.
1760 * enum.cs (Define): Implement.
1762 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
1764 * cs-parser.jay (overloadable_operator): The semantic value is an
1765 enum of the Operator class.
1766 (operator_declarator): Implement actions.
1767 (operator_declaration): Implement.
1769 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
1770 validity of definitions.
1771 (Operator::CheckBinaryOperator): Static method to check for binary operators
1772 (TypeContainer::AddOperator): New method to add an operator to a type.
1774 * cs-parser.jay (indexer_declaration): Added line to actually call the
1775 AddIndexer method so it gets added ;-)
1777 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
1778 already taken care of by the MS compiler ?
1780 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
1782 * class.cs (Operator): New class for operator declarations.
1783 (Operator::OpType): Enum for the various operators.
1785 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
1787 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
1788 ostensibly handle this in semantic analysis.
1790 * cs-parser.jay (general_catch_clause): Comment out
1791 (specific_catch_clauses, specific_catch_clause): Ditto.
1792 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
1793 (catch_args, opt_catch_args): New productions.
1794 (catch_clause): Rewrite to use the new productions above
1795 (catch_clauses): Modify accordingly.
1796 (opt_catch_clauses): New production to use in try_statement
1797 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
1798 and re-write the code in the actions to extract the specific and
1799 general catch clauses by being a little smart ;-)
1801 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
1802 Hooray, try and catch statements parse fine !
1804 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1806 * statement.cs (Block::GetVariableType): Fix logic to extract the type
1807 string from the hashtable of variables.
1809 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
1810 I end up making that mistake ;-)
1811 (catch_clauses): Fixed gross error which made Key and Value of the
1812 DictionaryEntry the same : $1 !!
1814 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1816 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
1818 * cs-parser.jay (event_declaration): Correct to remove the semicolon
1819 when the add and remove accessors are specified.
1821 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1823 * cs-parser.jay (IndexerDeclaration): New helper class to hold
1824 information about indexer_declarator.
1825 (indexer_declarator): Implement actions.
1826 (parsing_indexer): New local boolean used to keep track of whether
1827 we are parsing indexers or properties. This is necessary because
1828 implicit_parameters come into picture even for the get accessor in the
1830 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
1832 * class.cs (Indexer): New class for indexer declarations.
1833 (TypeContainer::AddIndexer): New method to add an indexer to a type.
1834 (TypeContainer::indexers): New member to hold list of indexers for the
1837 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
1839 * cs-parser.jay (add_accessor_declaration): Implement action.
1840 (remove_accessor_declaration): Implement action.
1841 (event_accessors_declaration): Implement
1842 (variable_declarators): swap statements for first rule - trivial.
1844 * class.cs (Event): New class to hold information about event
1846 (TypeContainer::AddEvent): New method to add an event to a type
1847 (TypeContainer::events): New member to hold list of events.
1849 * cs-parser.jay (event_declaration): Implement actions.
1851 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
1853 * cs-parser.jay (dim_separators): Implement. Make it a string
1854 concatenating all the commas together, just as they appear.
1855 (opt_dim_separators): Modify accordingly
1856 (rank_specifiers): Update accordingly. Basically do the same
1857 thing - instead, collect the brackets here.
1858 (opt_rank_sepcifiers): Modify accordingly.
1859 (array_type): Modify to actually return the complete type string
1860 instead of ignoring the rank_specifiers.
1861 (expression_list): Implement to collect the expressions
1862 (variable_initializer): Implement. We make it a list of expressions
1863 essentially so that we can handle the array_initializer case neatly too.
1864 (variable_initializer_list): Implement.
1865 (array_initializer): Make it a list of variable_initializers
1866 (opt_array_initializer): Modify accordingly.
1868 * expression.cs (New::NType): Add enumeration to help us
1869 keep track of whether we have an object/delegate creation
1870 or an array creation.
1871 (New:NewType, New::Rank, New::Indices, New::Initializers): New
1872 members to hold data about array creation.
1873 (New:New): Modify to update NewType
1874 (New:New): New Overloaded contructor for the array creation
1877 * cs-parser.jay (array_creation_expression): Implement to call
1878 the overloaded New constructor.
1880 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
1882 * class.cs (TypeContainer::Constructors): Return member
1883 constructors instead of returning null.
1885 2001-08-26 Miguel de Icaza <miguel@ximian.com>
1887 * typemanager.cs (InitCoreTypes): Initialize the various core
1888 types after we have populated the type manager with the user
1889 defined types (this distinction will be important later while
1890 compiling corlib.dll)
1892 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
1893 on Expression Classification. Now all expressions have a method
1894 `Resolve' and a method `Emit'.
1896 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
1897 generation from working. Also add some temporary debugging
1900 2001-08-24 Miguel de Icaza <miguel@ximian.com>
1902 * codegen.cs: Lots of code generation pieces. This is only the
1903 beginning, will continue tomorrow with more touches of polish. We
1904 handle the fundamentals of if, while, do, for, return. Others are
1905 trickier and I need to start working on invocations soon.
1907 * gen-treedump.cs: Bug fix, use s.Increment here instead of
1910 * codegen.cs (EmitContext): New struct, used during code
1911 emission to keep a context. Most of the code generation will be
1914 * cs-parser.jay: Add embedded blocks to the list of statements of
1915 this block. So code generation proceeds in a top down fashion.
1917 2001-08-23 Miguel de Icaza <miguel@ximian.com>
1919 * statement.cs: Add support for multiple child blocks.
1921 2001-08-22 Miguel de Icaza <miguel@ximian.com>
1923 * codegen.cs (EmitCode): New function, will emit the code for a
1924 Block of code given a TypeContainer and its ILGenerator.
1926 * statement.cs (Block): Standard public readonly optimization.
1927 (Block::Block constructors): Link children.
1928 (Block::Child): Child Linker.
1929 (Block::EmitVariables): Emits IL variable declarations.
1931 * class.cs: Drop support for MethodGroups here, delay until
1933 (Method::): Applied the same simplification that I did before, and
1934 move from Properties to public readonly fields.
1935 (Method::ParameterTypes): Returns the parameter types for the
1936 function, and implements a cache that will be useful later when I
1937 do error checking and the semantic analysis on the methods is
1939 (Constructor::GetCallingConvention): Renamed from CallingConvetion
1940 and made a method, optional argument tells whether this is a class
1941 or a structure to apply the `has-this' bit.
1942 (Method::GetCallingConvention): Implement, returns the calling
1944 (Method::Define): Defines the type, a second pass is performed
1945 later to populate the methods.
1947 (Constructor::ParameterTypes): implement a cache similar to the
1948 one on Method::ParameterTypes, useful later when we do semantic
1951 (TypeContainer::EmitMethod): New method. Emits methods.
1953 * expression.cs: Removed MethodGroup class from here.
1955 * parameter.cs (Parameters::GetCallingConvention): new method.
1957 2001-08-21 Miguel de Icaza <miguel@ximian.com>
1959 * class.cs (TypeContainer::Populate): Drop RootContext from the
1962 (Constructor::CallingConvention): Returns the calling convention.
1963 (Constructor::ParameterTypes): Returns the constructor parameter
1966 (TypeContainer::AddConstructor): Keep track of default constructor
1967 and the default static constructor.
1969 (Constructor::) Another class that starts using `public readonly'
1970 instead of properties.
1972 (Constructor::IsDefault): Whether this is a default constructor.
1974 (Field::) use readonly public fields instead of properties also.
1976 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
1977 track of static constructors; If none is used, turn on
1978 BeforeFieldInit in the TypeAttributes.
1980 * cs-parser.jay (opt_argument_list): now the return can be null
1981 for the cases where there are no arguments.
1983 (constructor_declarator): If there is no implicit `base' or
1984 `this', then invoke the default parent constructor.
1986 * modifiers.cs (MethodAttr): New static function maps a set of
1987 modifiers flags into a MethodAttributes enum
1988 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
1989 MethodAttr, TypeAttr to represent the various mappings where the
1991 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
1993 2001-08-19 Miguel de Icaza <miguel@ximian.com>
1995 * parameter.cs (GetParameterInfo): Fix bug where there would be no
1998 * interface.cs (PopulateIndexer): Implemented the code generator
1999 for interface indexers.
2001 2001-08-17 Miguel de Icaza <miguel@ximian.com>
2003 * interface.cs (InterfaceMemberBase): Now we track the new status
2006 (PopulateProperty): Implement property population. Woohoo! Got
2007 Methods and Properties going today.
2009 Removed all the properties for interfaces, and replaced them with
2010 `public readonly' fields.
2012 2001-08-16 Miguel de Icaza <miguel@ximian.com>
2014 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
2015 initialize their hashtables/arraylists only when they are needed
2016 instead of doing this always.
2018 * parameter.cs: Handle refs and out parameters.
2020 * cs-parser.jay: Use an ArrayList to construct the arguments
2021 instead of the ParameterCollection, and then cast that to a
2024 * parameter.cs: Drop the use of ParameterCollection and use
2025 instead arrays of Parameters.
2027 (GetParameterInfo): Use the Type, not the Name when resolving
2030 2001-08-13 Miguel de Icaza <miguel@ximian.com>
2032 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
2033 and instead use public readonly fields.
2035 * class.cs: Put back walking code for type containers.
2037 2001-08-11 Miguel de Icaza <miguel@ximian.com>
2039 * class.cs (MakeConstant): Code to define constants.
2041 * rootcontext.cs (LookupType): New function. Used to locate types
2044 2001-08-08 Miguel de Icaza <miguel@ximian.com>
2046 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
2047 this System.Reflection code is. Kudos to Microsoft
2049 * typemanager.cs: Implement a type cache and avoid loading all
2050 types at boot time. Wrap in LookupType the internals. This made
2051 the compiler so much faster. Wow. I rule!
2053 * driver.cs: Make sure we always load mscorlib first (for
2054 debugging purposes, nothing really important).
2056 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
2057 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
2059 * rootcontext.cs: Lookup types on their namespace; Lookup types
2060 on namespaces that have been imported using the `using' keyword.
2062 * class.cs (TypeContainer::TypeAttr): Virtualize.
2063 (Class::TypeAttr): Return attributes suitable for this bad boy.
2064 (Struct::TypeAttr): ditto.
2065 Handle nested classes.
2066 (TypeContainer::) Remove all the type visiting code, it is now
2067 replaced with the rootcontext.cs code
2069 * rootcontext.cs (GetClassBases): Added support for structs.
2071 2001-08-06 Miguel de Icaza <miguel@ximian.com>
2073 * interface.cs, statement.cs, class.cs, parameter.cs,
2074 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
2075 Drop use of TypeRefs, and use strings instead.
2077 2001-08-04 Miguel de Icaza <miguel@ximian.com>
2081 * class.cs (Struct::Struct): set the SEALED flags after
2082 checking the modifiers.
2083 (TypeContainer::TypeAttr): new property, returns the
2084 TypeAttributes for a class.
2086 * cs-parser.jay (type_list): Oops, list production was creating a
2087 new list of base types.
2089 * rootcontext.cs (StdLib): New property.
2090 (GetInterfaceTypeByName): returns an interface by type name, and
2091 encapsulates error handling here.
2092 (GetInterfaces): simplified.
2093 (ResolveTree): Encapsulated all the tree resolution here.
2094 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
2097 * driver.cs: Add support for --nostdlib, to avoid loading the
2099 (Main): Do not put tree resolution here.
2101 * rootcontext.cs: Beginning of the class resolution.
2103 2001-08-03 Miguel de Icaza <miguel@ximian.com>
2105 * rootcontext.cs: Provide better error reporting.
2107 * cs-parser.jay (interface_base): set our $$ to be interfaces.
2109 * rootcontext.cs (CreateInterface): Handle the case where there
2110 are no parent interfaces.
2112 (CloseTypes): Routine to flush types at the end.
2113 (CreateInterface): Track types.
2114 (GetInterfaces): Returns an array of Types from the list of
2117 * typemanager.c (AddUserType): Mechanism to track user types (puts
2118 the type on the global type hash, and allows us to close it at the
2121 2001-08-02 Miguel de Icaza <miguel@ximian.com>
2123 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
2124 RecordInterface instead.
2126 * cs-parser.jay: Updated to reflect changes above.
2128 * decl.cs (Definition): Keep track of the TypeBuilder type that
2129 represents this type here. Not sure we will use it in the long
2130 run, but wont hurt for now.
2132 * driver.cs: Smaller changes to accomodate the new code.
2134 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
2137 * rootcontext.cs (CreateInterface): New method, used to create
2138 the System.TypeBuilder type for interfaces.
2139 (ResolveInterfaces): new entry point to resolve the interface
2141 (CodeGen): Property, used to keep track of the code generator.
2143 2001-07-26 Miguel de Icaza <miguel@ximian.com>
2145 * cs-parser.jay: Add a second production for delegate_declaration
2148 (enum_body): Put an opt_comma here instead of putting it on
2149 enum_body or enum_member_declarations so we can handle trailing
2150 commas on enumeration members. Gets rid of a shift/reduce.
2152 (type_list): Need a COMMA in the middle.
2154 (indexer_declaration): Tell tokenizer to recognize get/set
2156 * Remove old targets.
2158 * Re-add the parser target.
2160 2001-07-13 Simon Cozens <simon@simon-cozens.org>
2162 * cs-parser.jay: Add precendence rules for a number of operators
2163 ot reduce the number of shift/reduce conflicts in the grammar.
2165 2001-07-17 Miguel de Icaza <miguel@ximian.com>
2167 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
2170 Get rid of old crufty code.
2172 * rootcontext.cs: Use this to keep track of the parsed
2173 representation and the defined types available to the program.
2175 * gen-treedump.cs: adjust for new convention.
2177 * type.cs: Split out the type manager, and the assembly builder
2180 * typemanager.cs: the type manager will live here now.
2182 * cil-codegen.cs: And the code generator here.
2184 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
2186 * makefile: Fixed up for easy making.
2188 2001-07-13 Simon Cozens <simon@simon-cozens.org>
2190 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
2193 (unary_expression): Expand pre_increment_expression and
2194 post_decrement_expression to reduce a shift/reduce.
2196 2001-07-11 Simon Cozens
2198 * cs-tokenizer.cs: Hex numbers should begin with a 0.
2200 Improve allow_keyword_as_indent name.
2202 2001-06-19 Miguel de Icaza <miguel@ximian.com>
2204 * Adjustments for Beta2.
2206 2001-06-13 Miguel de Icaza <miguel@ximian.com>
2208 * decl.cs: Added `Define' abstract method.
2209 (InTransit): new property, used to catch recursive definitions.
2211 * interface.cs: Implement `Define'.
2213 * modifiers.cs: Map Modifiers.constants to
2214 System.Reflection.TypeAttribute flags.
2216 * class.cs: Keep track of types and user-defined types.
2217 (BuilderInit): New method for creating an assembly
2218 (ResolveType): New function to launch the resolution process, only
2219 used by interfaces for now.
2221 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
2222 that are inserted into the name space.
2224 2001-06-08 Miguel de Icaza <miguel@ximian.com>
2226 * ARGH. I have screwed up my tree so many times due to the use of
2227 rsync rather than using CVS. Going to fix this at once.
2229 * driver.cs: Objetify driver. Load assemblies, use assemblies to
2232 2001-06-07 Miguel de Icaza <miguel@ximian.com>
2234 * Experiment successful: Use System.Type rather that our own
2237 2001-05-25 Miguel de Icaza <miguel@ximian.com>
2239 * cs-parser.jay: Removed nsAliases from here.
2241 Use new namespaces, handle `using XXX;'
2243 * namespace.cs: Reimplemented namespace handling, use a recursive
2244 definition of the class. Now we can keep track of using clauses
2245 and catch invalid using clauses.
2247 2001-05-24 Miguel de Icaza <miguel@ximian.com>
2249 * gen-treedump.cs: Adapted for all the renaming.
2251 * expression.cs (Expression): this class now has a Type property
2252 which returns an expression Type.
2254 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
2255 `Type', as this has a different meaning now in the base
2257 2001-05-22 Miguel de Icaza <miguel@ximian.com>
2259 * interface.cs, class.cs: Removed from all the sources the
2260 references to signature computation, as we can not do method
2261 signature computation during the parsing time, as we are not
2262 trying to solve at that point distinguishing:
2266 void a (NS.Blah x) {}
2269 Which depending on the context might be valid or not, as we do not
2270 know if Blah is the same thing as NS.Blah at that point.
2272 * Redid everything so the code uses TypeRefs now instead of
2273 Types. TypeRefs are just temporary type placeholders, that need
2274 to be resolved. They initially have a pointer to a string and the
2275 current scope in which they are used. This is used later by the
2276 compiler to resolve the reference to an actual Type.
2278 * DeclSpace is no longer a CIR.Type, and neither are
2279 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
2280 are all DeclSpaces, but no Types.
2282 * type.cs (TypeRefManager): This implements the TypeRef manager,
2283 which keeps track of all the types that need to be resolved after
2284 the parsing has finished.
2286 2001-05-13 Miguel de Icaza <miguel@ximian.com>
2288 * ARGH. We are going to have to store `foreach' as a class rather
2289 than resolving it, as we need to verify error 1579 after name
2290 resolution. *OR* we could keep a flag that says `This request to
2291 IEnumerator comes from a foreach statement' which we can then use
2292 to generate the error.
2294 2001-05-10 Miguel de Icaza <miguel@ximian.com>
2296 * class.cs (TypeContainer.AddMethod): we now add methods to the
2297 MethodGroup instead of the method hashtable.
2299 * expression.cs: Add MethodGroup abstraction, which gets us one
2300 step closer to the specification in the way we handle method
2303 * cs-parser.jay (primary_expression): qualified_identifier now
2304 tried to match up an identifier to a local variable reference or
2305 to a parameter reference.
2307 current_local_parameters is now a parser global variable that
2308 points to the current parameters for the block, used during name
2311 (property_declaration): Now creates an implicit `value' argument to
2314 2001-05-09 Miguel de Icaza <miguel@ximian.com>
2316 * parameter.cs: Do not use `param' arguments as part of the
2317 signature, per the spec.
2319 2001-05-08 Miguel de Icaza <miguel@ximian.com>
2321 * decl.cs: Base class for classes, structs and interfaces. This
2322 is the "Declaration Space"
2324 * cs-parser.jay: Use CheckDef for checking declaration errors
2325 instead of having one on each function.
2327 * class.cs: Factor out some code for handling error handling in
2328 accordance to the "Declarations" section in the "Basic Concepts"
2329 chapter in the ECMA C# spec.
2331 * interface.cs: Make all interface member classes derive from
2332 InterfaceMemberBase.
2334 2001-05-07 Miguel de Icaza <miguel@ximian.com>
2336 * Many things: all interfaces are parsed and generated in
2337 gen-treedump. Support for member variables, constructors,
2338 destructors, properties, constants is there.
2340 Beginning of the IL backend, but very little done, just there for
2343 2001-04-29 Miguel de Icaza <miguel@ximian.com>
2345 * cs-parser.jay: Fix labeled statement.
2347 * cs-tokenizer.cs (escape): Escape " and ' always.
2348 ref_line, ref_name: keep track of the line/filename as instructed
2349 by #line by the compiler.
2352 2001-04-27 Miguel de Icaza <miguel@ximian.com>
2354 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
2355 to match the values in System.CodeDOM.
2357 Divid renamed to Divide.
2359 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
2361 (Statements.set): remove.
2363 * System.CodeDOM/CodeCatchClause.cs: always have a valid
2366 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
2367 falseStatements always have valid values.
2369 * cs-parser.jay: Use System.CodeDOM now.