1 2001-11-04 Ravi Pratap <ravi@ximian.com>
3 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
4 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
5 set custom atttributes.
7 * literal.cs (Literal::GetValue): New abstract method to return the actual
8 value of the literal, cast as an object.
10 (*Literal): Implement GetValue method.
12 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
13 expressions to the arraylist but objects of type Argument.
15 * class.cs (TypeContainer::Emit): Emit our attributes too.
17 (Method::Emit, Constructor::Emit): Ditto.
19 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20 to be ignoring earlier.
22 2001-11-03 Ravi Pratap <ravi@ximian.com>
24 * attribute.cs (AttributeSection::Define): Implement to do the business
25 of constructing a CustomAttributeBuilder.
27 (Attribute): New trivial class. Increases readability of code.
29 * cs-parser.jay : Update accordingly.
31 (positional_argument_list, named_argument_list, named_argument): New rules
33 (attribute_arguments): Use the above so that we are more correct.
35 2001-11-02 Ravi Pratap <ravi@ximian.com>
37 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
38 to perform all checks for a method with a params parameter.
40 (Invocation::OverloadResolve): Update to use the above method and therefore
41 cope correctly with params method invocations.
43 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
46 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
47 constructors in our parent too because we can't afford to miss out on
50 * attribute.cs (AttributeSection): New name for the class Attribute
52 Other trivial changes to improve readability.
54 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
55 use the new class names.
57 2001-11-01 Ravi Pratap <ravi@ximian.com>
59 * class.cs (Method::Define): Complete definition for params types too
61 (Indexer::Define): Ditto.
63 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
64 Cope everywhere with a request for info about the array parameter.
66 2001-11-01 Ravi Pratap <ravi@ximian.com>
68 * tree.cs (RecordNamespace): Fix up to check for the correct key.
70 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
71 local_variable_type to extract the string corresponding to the type.
73 (local_variable_type): Fixup the action to use the new helper method.
75 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
78 * expression.cs : Clean out code which uses the above.
80 2001-10-31 Ravi Pratap <ravi@ximian.com>
82 * typemanager.cs (RegisterMethod): Check if we already have an existing key
83 and bale out if necessary by returning a false.
85 (RegisterProperty): Ditto.
87 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
88 and print out appropriate error messages.
90 * interface.cs (everywhere): Ditto.
92 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
93 location to constructor.
95 * class.cs (Property, Event, Indexer): Update accordingly.
97 * ../errors/cs111.cs : Added.
99 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
100 of a method, as laid down by the spec.
102 (Invocation::OverloadResolve): Use the above method.
104 2001-10-31 Ravi Pratap <ravi@ximian.com>
106 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
107 now take a TypeContainer and a Parameters object.
109 (ParameterData): Modify return type of ParameterModifier method to be
110 Parameter.Modifier and not a string.
112 (ReflectionParameters, InternalParameters): Update accordingly.
114 * expression.cs (Argument::GetParameterModifier): Same here.
116 * support.cs (InternalParameters::ParameterType): Find a better way of determining
117 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
118 symbol in it at all so maybe this is only for now.
120 2001-10-30 Ravi Pratap <ravi@ximian.com>
122 * support.cs (InternalParameters): Constructor now takes an extra argument
123 which is the actual Parameters class.
125 (ParameterDesc): Update to provide info on ref/out modifiers.
127 * class.cs (everywhere): Update call to InternalParameters to pass in
128 the second argument too.
130 * support.cs (ParameterData): Add ParameterModifier, which is a method
131 to return the modifier info [ref/out etc]
133 (InternalParameters, ReflectionParameters): Implement the above.
135 * expression.cs (Argument::ParameterModifier): Similar function to return
136 info about the argument's modifiers.
138 (Invocation::OverloadResolve): Update to take into account matching modifiers
141 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
142 a new SetFormalParameters object which we pass to InternalParameters.
144 2001-10-30 Ravi Pratap <ravi@ximian.com>
146 * expression.cs (NewArray): Merge into the ArrayCreation class.
148 2001-10-29 Ravi Pratap <ravi@ximian.com>
150 * expression.cs (NewArray): Merge classes NewBuiltinArray and
151 NewUserdefinedArray into one as there wasn't much of a use in having
154 * expression.cs (Argument): Change field's name to ArgType from Type.
156 (Type): New readonly property which returns the proper type, taking into
157 account ref/out modifiers.
159 (everywhere): Adjust code accordingly for the above.
161 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
162 whether we are emitting for a ref or out parameter.
164 * expression.cs (Argument::Emit): Use the above field to set the state.
166 (LocalVariableReference::Emit): Update to honour the flag and emit the
169 * parameter.cs (Attributes): Set the correct flags for ref parameters.
171 * expression.cs (Argument::FullDesc): New function to provide a full desc.
173 * support.cs (ParameterData): Add method ParameterDesc to the interface.
175 (ReflectionParameters, InternalParameters): Implement the above method.
177 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
180 (Invocation::FullMethodDesc): Ditto.
182 2001-10-29 Miguel de Icaza <miguel@ximian.com>
184 * cs-parser.jay: Add extra production for the second form of array
187 * expression.cs (ArrayCreation): Update to reflect the above
190 * Small changes to prepare for Array initialization.
192 2001-10-28 Miguel de Icaza <miguel@ximian.com>
194 * typemanager.cs (ImplementsInterface): interface might be null;
195 Deal with this problem;
197 Also, we do store negative hits on the cache (null values), so use
198 this instead of calling t.GetInterfaces on the type everytime.
200 2001-10-28 Ravi Pratap <ravi@ximian.com>
202 * typemanager.cs (IsBuiltinType): New method to help determine the same.
204 * expression.cs (New::DoResolve): Get rid of array creation code and instead
205 split functionality out into different classes.
207 (New::FormArrayType): Move into NewBuiltinArray.
209 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
212 (NewBuiltinArray): New class to handle creation of built-in arrays.
214 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
215 account creation of one-dimensional arrays.
217 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
219 (NewUserdefinedArray::DoResolve): Implement.
221 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
223 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
224 we maintain inside the TypeManager. This is necessary to perform lookups on the
227 (LookupType): Update to perform GetType on the module builders too.
229 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
231 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
233 2001-10-23 Ravi Pratap <ravi@ximian.com>
235 * expression.cs (New::DoResolve): Implement guts of array creation.
237 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
239 2001-10-27 Miguel de Icaza <miguel@ximian.com>
241 * expression.cs: Fix bug I introduced lsat night that broke
244 (Expression.Resolve): Report a 246 error (can not resolve name)
245 if we find a SimpleName in the stream.
247 (Expression.ResolveLValue): Ditto.
249 (Expression.ResolveWithSimpleName): This function is a variant of
250 ResolveName, this one allows SimpleNames to be returned without a
251 warning. The only consumer of SimpleNames is MemberAccess
253 2001-10-26 Miguel de Icaza <miguel@ximian.com>
255 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
256 might arrive here. I have my doubts that this is correct.
258 * statement.cs (Lock): Implement lock statement.
260 * cs-parser.jay: Small fixes to support `lock' and `using'
262 * cs-tokenizer.cs: Remove extra space
264 * driver.cs: New flag --checked, allows to turn on integer math
267 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
268 Threading.Monitor.Exit
270 2001-10-23 Miguel de Icaza <miguel@ximian.com>
272 * expression.cs (IndexerAccess::DoResolveLValue): Set the
273 Expression Class to be IndexerAccess.
275 Notice that Indexer::DoResolve sets the eclass to Value.
277 2001-10-22 Miguel de Icaza <miguel@ximian.com>
279 * class.cs (TypeContainer::Emit): Emit code for indexers.
281 * assign.cs (IAssignMethod): New interface implemented by Indexers
282 and Properties for handling assignment.
284 (Assign::Emit): Simplify and reuse code.
286 * expression.cs (IndexerAccess, PropertyExpr): Implement
287 IAssignMethod, clean up old code.
289 2001-10-22 Ravi Pratap <ravi@ximian.com>
291 * typemanager.cs (ImplementsInterface): New method to determine if a type
292 implements a given interface. Provides a nice cache too.
294 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
297 (ConvertReferenceExplicit): Ditto.
299 * delegate.cs (Delegate::Populate): Update to define the parameters on the
300 various methods, with correct names etc.
302 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
303 Operator.UnaryNegation.
305 * cs-parser.jay (operator_declarator): Be a little clever in the case where
306 we have a unary plus or minus operator.
308 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
311 * everywhere : update accordingly.
313 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
316 * class.cs (Method::Define): For the case where we are implementing a method
317 inherited from an interface, we need to set the MethodAttributes.Final flag too.
318 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
320 2001-10-21 Ravi Pratap <ravi@ximian.com>
322 * interface.cs (FindMembers): Implement to work around S.R.E
325 * typemanager.cs (IsInterfaceType): Implement.
327 (FindMembers): Update to handle interface types too.
329 * expression.cs (ImplicitReferenceConversion): Re-write bits which
330 use IsAssignableFrom as that is not correct - it doesn't work.
332 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
333 and accordingly override EmitStatement.
335 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
336 using the correct logic :-)
338 2001-10-19 Ravi Pratap <ravi@ximian.com>
340 * ../errors/cs-11.cs : Add to demonstrate error -11
342 2001-10-17 Miguel de Icaza <miguel@ximian.com>
344 * assign.cs (Assign::Resolve): Resolve right hand side first, and
345 then pass this as a hint to ResolveLValue.
347 * expression.cs (FieldExpr): Add Location information
349 (FieldExpr::LValueResolve): Report assignment to readonly
352 (Expression::ExprClassFromMemberInfo): Pass location information.
354 (Expression::ResolveLValue): Add new method that resolves an
357 (Expression::DoResolveLValue): Default invocation calls
360 (Indexers): New class used to keep track of indexers in a given
363 (IStackStore): Renamed from LValue, as it did not really describe
364 what this did. Also ResolveLValue is gone from this interface and
365 now is part of Expression.
367 (ElementAccess): Depending on the element access type
369 * typemanager.cs: Add `indexer_name_type' as a Core type
370 (System.Runtime.CompilerServices.IndexerNameAttribute)
372 * statement.cs (Goto): Take a location.
374 2001-10-18 Ravi Pratap <ravi@ximian.com>
376 * delegate.cs (Delegate::VerifyDelegate): New method to verify
377 if two delegates are compatible.
379 (NewDelegate::DoResolve): Update to take care of the case when
380 we instantiate a delegate from another delegate.
382 * typemanager.cs (FindMembers): Don't even try to look up members
383 of Delegate types for now.
385 2001-10-18 Ravi Pratap <ravi@ximian.com>
387 * delegate.cs (NewDelegate): New class to take care of delegate
390 * expression.cs (New): Split the delegate related code out into
391 the NewDelegate class.
393 * delegate.cs (DelegateInvocation): New class to handle delegate
396 * expression.cs (Invocation): Split out delegate related code into
397 the DelegateInvocation class.
399 2001-10-17 Ravi Pratap <ravi@ximian.com>
401 * expression.cs (New::DoResolve): Implement delegate creation fully
402 and according to the spec.
404 (New::DoEmit): Update to handle delegates differently.
406 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
407 because of which we were printing out arguments in reverse order !
409 * delegate.cs (VerifyMethod): Implement to check if the given method
410 matches the delegate.
412 (FullDelegateDesc): Implement.
414 (VerifyApplicability): Implement.
416 * expression.cs (Invocation::DoResolve): Update to accordingly handle
417 delegate invocations too.
419 (Invocation::Emit): Ditto.
421 * ../errors/cs1593.cs : Added.
423 * ../errors/cs1594.cs : Added.
425 * delegate.cs (InstanceExpression, TargetMethod): New properties.
427 2001-10-16 Ravi Pratap <ravi@ximian.com>
429 * typemanager.cs (intptr_type): Core type for System.IntPtr
431 (InitCoreTypes): Update for the same.
433 (iasyncresult_type, asynccallback_type): Ditto.
435 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
438 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
441 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
442 the builders for the 4 members of a delegate type :-)
444 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
447 * expression.cs (New::DoResolve): Implement guts for delegate creation.
449 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
451 2001-10-15 Miguel de Icaza <miguel@ximian.com>
453 * statement.cs (Break::Emit): Implement.
454 (Continue::Emit): Implement.
456 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
457 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
458 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
459 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
462 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
463 properties that track the label for the current loop (begin of the
464 loop and end of the loop).
466 2001-10-15 Ravi Pratap <ravi@ximian.com>
468 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
469 use of emitting anything at all.
471 * class.cs, rootcontext.cs : Get rid of calls to the same.
473 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
475 (Populate): Define the constructor correctly and set the implementation
478 * typemanager.cs (delegate_types): New hashtable to hold delegates that
481 (AddDelegateType): Implement.
483 (IsDelegateType): Implement helper method.
485 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
487 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
488 and accordingly handle it.
490 * delegate.cs (Populate): Take TypeContainer argument.
491 Implement bits to define the Invoke method. However, I still haven't figured out
492 how to take care of the native int bit :-(
494 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
495 Qualify the name of the delegate, not its return type !
497 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
500 (StandardConversionExists): Checking for array types turns out to be recursive.
502 (ConvertReferenceExplicit): Implement array conversion.
504 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
506 2001-10-12 Ravi Pratap <ravi@ximian.com>
508 * cs-parser.jay (delegate_declaration): Store the fully qualified
509 name as it is a type declaration.
511 * delegate.cs (ReturnType, Name): Rename members to these. Make them
514 (DefineDelegate): Renamed from Define. Does the same thing essentially,
515 as TypeContainer::DefineType.
517 (Populate): Method in which all the definition of the various methods (Invoke)
520 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
523 (CloseDelegate): Finally creates the delegate.
525 * class.cs (TypeContainer::DefineType): Update to define delegates.
526 (Populate, Emit and CloseType): Do the same thing here too.
528 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
529 delegates in all these operations.
531 2001-10-14 Miguel de Icaza <miguel@ximian.com>
533 * expression.cs: LocalTemporary: a new expression used to
534 reference a temporary that has been created.
536 * assign.cs: Handle PropertyAccess back here, so that we can
537 provide the proper semantic access to properties.
539 * expression.cs (Expression::ConvertReferenceExplicit): Implement
540 a few more explicit conversions.
542 * modifiers.cs: `NEW' modifier maps to HideBySig.
544 * expression.cs (PropertyExpr): Make this into an
545 ExpressionStatement, and support the EmitStatement code path.
547 Perform get/set error checking, clean up the interface.
549 * assign.cs: recognize PropertyExprs as targets, and if so, turn
550 them into toplevel access objects.
552 2001-10-12 Miguel de Icaza <miguel@ximian.com>
554 * expression.cs: PropertyExpr::PropertyExpr: use work around the
557 * typemanager.cs: Keep track here of our PropertyBuilders again to
558 work around lameness in SRE.
560 2001-10-11 Miguel de Icaza <miguel@ximian.com>
562 * expression.cs (LValue::LValueResolve): New method in the
563 interface, used to perform a second resolution pass for LValues.
565 (This::DoResolve): Catch the use of this in static methods.
567 (This::LValueResolve): Implement.
569 (This::Store): Remove warning, assigning to `this' in structures
572 (Invocation::Emit): Deal with invocation of
573 methods on value types. We need to pass the address to structure
574 methods rather than the object itself. (The equivalent code to
575 emit "this" for structures leaves the entire structure on the
576 stack instead of a pointer to it).
578 (ParameterReference::DoResolve): Compute the real index for the
579 argument based on whether the method takes or not a `this' pointer
580 (ie, the method is static).
582 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
583 value types returned from functions when we need to invoke a
584 method on the sturcture.
587 2001-10-11 Ravi Pratap <ravi@ximian.com>
589 * class.cs (TypeContainer::DefineType): Method to actually do the business of
590 defining the type in the Modulebuilder or Typebuilder. This is to take
591 care of nested types which need to be defined on the TypeBuilder using
594 (TypeContainer::GetClassBases): Implement. Essentially the code from the
595 methods in RootContext, only ported to be part of TypeContainer.
597 (TypeContainer::GetInterfaceOrClass): Ditto.
599 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
601 * interface.cs (Interface::DefineInterface): New method. Does exactly
602 what RootContext.CreateInterface did earlier, only it takes care of nested types
605 (Interface::GetInterfaces): Move from RootContext here and port.
607 (Interface::GetInterfaceByName): Same here.
609 * rootcontext.cs (ResolveTree): Re-write.
611 (PopulateTypes): Re-write.
613 * class.cs (TypeContainer::Populate): Populate nested types too.
614 (TypeContainer::Emit): Emit nested members too.
616 * typemanager.cs (AddUserType): Do not make use of the FullName property,
617 instead just use the name argument passed in as it is already fully
620 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
621 to TypeContainer mapping to see if a type is user-defined.
623 * class.cs (TypeContainer::CloseType): Implement.
625 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
626 the default constructor.
628 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
631 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
633 * interface.cs (CloseType): Create the type here.
635 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
638 Remove all the methods which are now in TypeContainer.
640 2001-10-10 Ravi Pratap <ravi@ximian.com>
642 * delegate.cs (Define): Re-write bits to define the delegate
645 2001-10-10 Miguel de Icaza <miguel@ximian.com>
647 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
649 * expression.cs (ImplicitReferenceConversion): handle null as well
650 as a source to convert to any reference type.
652 * statement.cs (Return): Perform any implicit conversions to
653 expected return type.
655 Validate use of return statement.
657 * codegen.cs (EmitContext): Pass the expected return type here.
659 * class.cs (Method, Constructor, Property): Pass expected return
662 2001-10-09 Miguel de Icaza <miguel@ximian.com>
664 * expression.cs: Make DoResolve take an EmitContext instead of a
667 Replaced `l' and `location' for `loc', for consistency.
669 (Error, Warning): Remove unneeded Tc argument.
671 * assign.cs, literal.cs, constant.cs: Update to new calling
674 * codegen.cs: EmitContext now contains a flag indicating whether
675 code is being generated in a static method or not.
677 * cs-parser.jay: DecomposeQI, new function that replaces the old
678 QualifiedIdentifier. Now we always decompose the assembled
679 strings from qualified_identifier productions into a group of
682 2001-10-08 Miguel de Icaza <miguel@ximian.com>
684 * rootcontext.cs: Deal with field-less struct types correctly now
685 by passing the size option to Define Type.
687 * class.cs: Removed hack that created one static field.
689 2001-10-07 Miguel de Icaza <miguel@ximian.com>
691 * statement.cs: Moved most of the code generation here.
693 2001-10-09 Ravi Pratap <ravi@ximian.com>
695 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
698 (ElementAccess): Remove useless bits for now - keep checks as the spec
701 2001-10-08 Ravi Pratap <ravi@ximian.com>
703 * expression.cs (ElementAccess::DoResolve): Remove my crap code
704 and start performing checks according to the spec.
706 2001-10-07 Ravi Pratap <ravi@ximian.com>
708 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
709 rank_specifiers instead.
711 (rank_specifiers): Change the order in which the rank specifiers are stored
713 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
715 * expression.cs (ElementAccess): Implement the LValue interface too.
717 2001-10-06 Ravi Pratap <ravi@ximian.com>
719 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
720 except that user defined conversions are not included.
722 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
723 perform the conversion of the return type, if necessary.
725 (New::DoResolve): Check whether we are creating an array or an object
726 and accordingly do the needful.
728 (New::Emit): Same here.
730 (New::DoResolve): Implement guts of array creation.
732 (New::FormLookupType): Helper function.
734 2001-10-07 Miguel de Icaza <miguel@ximian.com>
736 * codegen.cs: Removed most of the code generation here, and move the
737 corresponding code generation bits to the statement classes.
739 Added support for try/catch/finalize and throw.
741 * cs-parser.jay: Added support for try/catch/finalize.
743 * class.cs: Catch static methods having the flags override,
746 * expression.cs (UserCast): This user cast was not really doing
747 what it was supposed to do. Which is to be born in fully resolved
748 state. Parts of the resolution were being performed at Emit time!
752 2001-10-05 Miguel de Icaza <miguel@ximian.com>
754 * expression.cs: Implicity convert the result from UserCast.
756 2001-10-05 Ravi Pratap <ravi@ximian.com>
758 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
759 prevented it from working correctly.
761 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
762 merely ConvertImplicit.
764 2001-10-05 Miguel de Icaza <miguel@ximian.com>
766 * typemanager.cs: Make the LookupTypeContainer function static,
767 and not per-instance.
769 * class.cs: Make static FindMembers (the one that takes a Type
772 * codegen.cs: Add EmitForeach here.
774 * cs-parser.jay: Make foreach a toplevel object instead of the
775 inline expansion, as we need to perform semantic analysis on it.
777 2001-10-05 Ravi Pratap <ravi@ximian.com>
779 * expression.cs (Expression::ImplicitUserConversion): Rename to
780 UserDefinedConversion.
782 (Expression::UserDefinedConversion): Take an extra argument specifying
783 whether we look for explicit user conversions too.
785 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
787 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
789 (ExplicitUserConversion): Make it a call to UserDefinedConversion
790 with the appropriate arguments.
792 * cs-parser.jay (cast_expression): Record location too.
794 * expression.cs (Cast): Record location info.
796 (Expression::ConvertExplicit): Take location argument.
798 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
799 to determine if we are doing explicit conversions.
801 (UserCast::Emit): Update accordingly.
803 (Expression::ConvertExplicit): Report an error if everything fails.
805 * ../errors/cs0030.cs : Add.
807 2001-10-04 Miguel de Icaza <miguel@ximian.com>
809 * modifiers.cs: If the ABSTRACT keyword is present, also set the
810 virtual and newslot bits.
812 * class.cs (TypeContainer::RegisterRequiredImplementations):
813 Record methods we need.
815 (TypeContainer::MakeKey): Helper function to make keys for
816 MethodBases, since the Methodbase key is useless.
818 (TypeContainer::Populate): Call RegisterRequiredImplementations
819 before defining the methods.
821 Create a mapping for method_builders_to_methods ahead of time
822 instead of inside a tight loop.
824 (::RequireMethods): Accept an object as the data to set into the
825 hashtable so we can report interface vs abstract method mismatch.
827 2001-10-03 Miguel de Icaza <miguel@ximian.com>
829 * report.cs: Make all of it static.
831 * rootcontext.cs: Drop object_type and value_type computations, as
832 we have those in the TypeManager anyways.
834 Drop report instance variable too, now it is a global.
836 * driver.cs: Use try/catch on command line handling.
838 Add --probe option to debug the error reporting system with a test
841 * report.cs: Add support for exiting program when a probe
842 condition is reached.
844 2001-10-03 Ravi Pratap <ravi@ximian.com>
846 * expression.cs (Binary::DoNumericPromotions): Fix the case when
847 we do a forcible conversion regardless of type, to check if
848 ForceConversion returns a null.
850 (Binary::error19): Use location to report error.
852 (Unary::error23): Use location here too.
854 * ../errors/cs0019.cs : Check in.
856 * ../errors/cs0023.cs : Check in.
858 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
859 case of a non-null MethodInfo object with a length of 0 !
861 (Binary::ResolveOperator): Flag error if overload resolution fails to find
862 an applicable member - according to the spec :-)
863 Also fix logic to find members in base types.
865 (Unary::ResolveOperator): Same here.
867 (Unary::report23): Change name to error23 and make first argument a TypeContainer
868 as I was getting thoroughly confused between this and error19 :-)
870 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
871 (::FindMostEncompassedType): Implement.
872 (::FindMostEncompassingType): Implement.
873 (::StandardConversionExists): Implement.
875 (UserImplicitCast): Re-vamp. We now need info about most specific
876 source and target types so that we can do the necessary conversions.
878 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
879 mathematical union with no duplicates.
881 2001-10-03 Miguel de Icaza <miguel@ximian.com>
883 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
884 in order from base classes to child classes, so that we can in
885 child classes look up in our parent for method names and
886 attributes (required for handling abstract, virtual, new, override
887 constructs: we need to instrospect our base class, and if we dont
888 populate the classes in order, the introspection might be
889 incorrect. For example, a method could query its parent before
890 the parent has any methods and would determine that the parent has
891 no abstract methods (while it could have had them)).
893 (RootContext::CreateType): Record the order in which we define the
896 2001-10-02 Miguel de Icaza <miguel@ximian.com>
898 * class.cs (TypeContainer::Populate): Also method definitions can
899 fail now, keep track of this.
901 (TypeContainer::FindMembers): Implement support for
902 DeclaredOnly/noDeclaredOnly flag.
904 (Constructor::Emit) Return the ConstructorBuilder.
906 (Method::Emit) Return the MethodBuilder.
907 Check for abstract or virtual methods to be public.
909 * rootcontext.cs (RootContext::CreateType): Register all the
910 abstract methods required for the class to be complete and the
911 interface methods that must be implemented.
913 * cs-parser.jay: Report error 501 (method requires body if it is
914 not marked abstract or extern).
916 * expression.cs (TypeOf::Emit): Implement.
918 * typemanager.cs: runtime_handle_type, new global type.
920 * class.cs (Property::Emit): Generate code for properties.
922 2001-10-02 Ravi Pratap <ravi@ximian.com>
924 * expression.cs (Unary::ResolveOperator): Find operators on base type
925 too - we now conform exactly to the spec.
927 (Binary::ResolveOperator): Same here.
929 * class.cs (Operator::Define): Fix minor quirk in the tests.
931 * ../errors/cs0215.cs : Added.
933 * ../errors/cs0556.cs : Added.
935 * ../errors/cs0555.cs : Added.
937 2001-10-01 Miguel de Icaza <miguel@ximian.com>
939 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
940 single integer which is really efficient
942 2001-10-01 Ravi Pratap <ravi@ximian.com>
944 * expression.cs (Expression::ImplicitUserConversion): Use location
945 even in the case when we are examining True operators.
947 * class.cs (Operator::Define): Perform extensive checks to conform
948 with the rules for operator overloading in the spec.
950 * expression.cs (Expression::ImplicitReferenceConversion): Implement
951 some of the other conversions mentioned in the spec.
953 * typemanager.cs (array_type): New static member for the System.Array built-in
956 (cloneable_interface): For System.ICloneable interface.
958 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
959 we start resolving the tree and populating types.
961 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
963 2001-10-01 Miguel de Icaza <miguel@ximian.com>
965 * expression.cs (Expression::ExprClassFromMemberInfo,
966 Expression::Literalize): Create literal expressions from
967 FieldInfos which are literals.
969 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
970 type casts, because they were wrong. The test suite in tests
973 (ImplicitNumericConversion): ushort to ulong requires a widening
976 Int32 constant to long requires widening cast as well.
978 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
979 for integers because the type on the stack is not i4.
981 2001-09-30 Miguel de Icaza <miguel@ximian.com>
983 * expression.cs (report118): require location argument.
985 * parameter.cs: Do not dereference potential null value.
987 * class.cs: Catch methods that lack the `new' keyword when
988 overriding a name. Report warnings when `new' is used without
989 anything being there to override.
991 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
993 * class.cs: Only add constructor to hashtable if it is non-null
994 (as now constructors can fail on define).
996 (TypeManager, Class, Struct): Take location arguments.
998 Catch field instance initialization in structs as errors.
1000 accepting_filter: a new filter for FindMembers that is static so
1001 that we dont create an instance per invocation.
1003 (Constructor::Define): Catch errors where a struct constructor is
1006 * cs-parser.jay: Pass location information for various new
1009 * delegate.cs (Delegate): take a location argument.
1011 * driver.cs: Do not call EmitCode if there were problesm in the
1012 Definition of the types, as many Builders wont be there.
1014 * decl.cs (Decl::Decl): Require a location argument.
1016 * cs-tokenizer.cs: Handle properly hex constants that can not fit
1017 into integers, and find the most appropiate integer for it.
1019 * literal.cs: Implement ULongLiteral.
1021 * rootcontext.cs: Provide better information about the location of
1022 failure when CreateType fails.
1024 2001-09-29 Miguel de Icaza <miguel@ximian.com>
1026 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
1029 * expression.cs (Binary::CheckShiftArguments): Add missing type
1031 (Binary::ResolveOperator): Add type to the logical and and logical
1032 or, Bitwise And/Or and Exclusive Or code paths, it was missing
1035 (Binary::DoNumericPromotions): In the case where either argument
1036 is ulong (and most signed types combined with ulong cause an
1037 error) perform implicit integer constant conversions as well.
1039 2001-09-28 Miguel de Icaza <miguel@ximian.com>
1041 * expression.cs (UserImplicitCast): Method should always be
1043 (Invocation::BetterConversion): Simplified test for IntLiteral.
1045 (Expression::ImplicitNumericConversion): Split this routine out.
1046 Put the code that performs implicit constant integer conversions
1049 (Expression::Resolve): Become a wrapper around DoResolve so we can
1050 check eclass and type being set after resolve.
1052 (Invocation::Badness): Remove this dead function
1054 (Binary::ResolveOperator): Do not compute the expensive argumnets
1055 unless we have a union for it.
1057 (Probe::Emit): Is needs to do an isinst and then
1058 compare against null.
1060 (::CanConvert): Added Location argument. If the Location argument
1061 is null (Location.Null), then we do not report errors. This is
1062 used by the `probe' mechanism of the Explicit conversion. We do
1063 not want to generate an error for something that the user
1064 explicitly requested to be casted. But the pipeline for an
1065 explicit cast first tests for potential implicit casts.
1067 So for now, if the Location is null, it means `Probe only' to
1068 avoid adding another argument. Might have to revise this
1071 (ClassCast): New class used to type cast objects into arbitrary
1072 classes (used in Explicit Reference Conversions).
1074 Implement `as' as well.
1076 Reverted all the patches from Ravi below: they were broken:
1078 * The use of `level' as a mechanism to stop recursive
1079 invocations is wrong. That was there just to catch the
1080 bug with a strack trace but not as a way of addressing
1083 To fix the problem we have to *understand* what is going
1084 on and the interactions and come up with a plan, not
1085 just get things going.
1087 * The use of the type conversion cache that I proposed
1088 last night had an open topic: How does this work across
1089 protection domains. A user defined conversion might not
1090 be public in the location where we are applying the
1091 conversion, a different conversion might be selected
1092 (ie, private A->B (better) but public B->A (worse),
1093 inside A, A->B applies, but outside it, B->A will
1096 * On top of that (ie, even if the above is solved),
1097 conversions in a cache need to be abstract. Ie, `To
1098 convert from an Int to a Short use an OpcodeCast', not
1099 `To convert from an Int to a Short use the OpcodeCast on
1100 the variable 5' (which is what this patch was doing).
1102 2001-09-28 Ravi Pratap <ravi@ximian.com>
1104 * expression.cs (Invocation::ConversionExists): Re-write to use
1105 the conversion cache
1107 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
1108 cache all conversions done, not just user-defined ones.
1110 (Invocation::BetterConversion): The real culprit. Use ConversionExists
1111 to determine if a conversion exists instead of acutually trying to
1112 perform the conversion. It's faster too.
1114 (Expression::ConvertExplicit): Modify to use ConversionExists to check
1115 and only then attempt the implicit conversion.
1117 2001-09-28 Ravi Pratap <ravi@ximian.com>
1119 * expression.cs (ConvertImplicit): Use a cache for conversions
1120 already found. Check level of recursion and bail out if necessary.
1122 2001-09-28 Miguel de Icaza <miguel@ximian.com>
1124 * typemanager.cs (string_concat_string_string, string_concat_object_object):
1125 Export standard methods that we expect for string operations.
1127 * statement.cs (Block::UsageWarning): Track usage of variables and
1128 report the errors for not used variables.
1130 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
1133 2001-09-27 Miguel de Icaza <miguel@ximian.com>
1135 * codegen.cs: remove unnneded code
1137 * expression.cs: Removed BuiltinTypeAccess class
1139 Fix the order in which implicit conversions are
1142 The previous fixed dropped support for boxed conversions (adding a
1143 test to the test suite now)
1145 (UserImplicitCast::CanConvert): Remove test for source being null,
1146 that code is broken. We should not feed a null to begin with, if
1147 we do, then we should track the bug where the problem originates
1148 and not try to cover it up here.
1150 Return a resolved expression of type UserImplicitCast on success
1151 rather than true/false. Ravi: this is what I was talking about,
1152 the pattern is to use a static method as a "constructor" for
1155 Also, do not create arguments until the very last minute,
1156 otherwise we always create the arguments even for lookups that
1157 will never be performed.
1159 (UserImplicitCast::Resolve): Eliminate, objects of type
1160 UserImplicitCast are born in a fully resolved state.
1162 * typemanager.cs (InitCoreTypes): Init also value_type
1165 * expression.cs (Cast::Resolve): First resolve the child expression.
1167 (LValue): Add new method AddressOf to be used by
1170 Change the argument of Store to take an EmitContext instead of an
1171 ILGenerator, because things like FieldExpr need to be able to call
1172 their children expression to generate the instance code.
1174 (Expression::Error, Expression::Warning): Sugar functions for
1177 (Expression::MemberLookup): Accept a TypeContainer instead of a
1178 Report as the first argument.
1180 (Expression::ResolvePrimary): Killed. I still want to improve
1181 this as currently the code is just not right.
1183 (Expression::ResolveMemberAccess): Simplify, but it is still
1186 (Unary::Resolve): Catch errors in AddressOf operators.
1188 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
1189 index to a byte for the short-version, or the compiler will choose
1190 the wrong Emit call, which generates the wrong data.
1192 (ParameterReference::Emit, ::Store): same.
1194 (FieldExpr::AddressOf): Implement.
1196 * typemanager.cs: TypeManager: made public variable instead of
1199 * driver.cs: document --fatal.
1201 * report.cs (ErrorMessage, WarningMessage): new names for the old
1202 Error and Warning classes.
1204 * cs-parser.jay (member_access): Turn built-in access to types
1205 into a normal simplename
1207 2001-09-27 Ravi Pratap <ravi@ximian.com>
1209 * expression.cs (Invocation::BetterConversion): Fix to cope
1210 with q being null, since this was introducing a bug.
1212 * expression.cs (ConvertImplicit): Do built-in conversions first.
1214 2001-09-27 Ravi Pratap <ravi@ximian.com>
1216 * expression.cs (UserImplicitCast::Resolve): Fix bug.
1218 2001-09-27 Ravi Pratap <ravi@ximian.com>
1220 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
1221 I had introduced long ago (what's new ?).
1223 * expression.cs (UserImplicitCast::CanConvert): Static method to do
1224 the work of all the checking.
1225 (ConvertImplicit): Call CanConvert and only then create object if necessary.
1226 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
1228 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
1229 that is the right way.
1231 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
1232 overloading resolution. Use everywhere instead of cutting and pasting code.
1234 (Binary::ResolveOperator): Use MakeUnionSet.
1236 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
1237 we have to convert to bool types. Not complete yet.
1239 2001-09-27 Miguel de Icaza <miguel@ximian.com>
1241 * typemanager.cs (TypeManager::CSharpName): support ushort.
1243 * expression.cs (Expression::TryImplicitIntConversion): Attempts
1244 to provide an expression that performsn an implicit constant int
1245 conversion (section 6.1.6).
1246 (Expression::ConvertImplicitRequired): Reworked to include
1247 implicit constant expression conversions.
1249 (Expression::ConvertNumericExplicit): Finished.
1251 (Invocation::Emit): If InstanceExpression is null, then it means
1252 that we perform a call on this.
1254 2001-09-26 Miguel de Icaza <miguel@ximian.com>
1256 * expression.cs (Unary::Emit): Remove some dead code.
1257 (Probe): Implement Resolve and Emit for `is'.
1258 (Expression::ConvertImplicitRequired): Attempt to do constant
1259 expression conversions here. Maybe should be moved to
1260 ConvertImplicit, but I am not sure.
1261 (Expression::ImplicitLongConstantConversionPossible,
1262 Expression::ImplicitIntConstantConversionPossible): New functions
1263 that tell whether is it possible to apply an implicit constant
1264 expression conversion.
1266 (ConvertNumericExplicit): Started work on explicit numeric
1269 * cs-parser.jay: Update operator constants.
1271 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
1272 (Parameters::GetSignature): Hook up VerifyArgs here.
1273 (Parameters::VerifyArgs): Verifies that no two arguments have the
1276 * class.cs (Operator): Update the operator names to reflect the
1277 ones that the spec expects (as we are just stringizing the
1280 * expression.cs (Unary::ResolveOperator): Fix bug: Use
1281 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
1282 previous usage did only work for our methods.
1283 (Expression::ConvertImplicit): Handle decimal implicit numeric
1284 conversions as well.
1285 (Expression::InternalTypeConstructor): Used to invoke constructors
1286 on internal types for default promotions.
1288 (Unary::Emit): Implement special handling for the pre/post
1289 increment/decrement for overloaded operators, as they need to have
1290 the same semantics as the other operators.
1292 (Binary::ResolveOperator): ditto.
1293 (Invocation::ConversionExists): ditto.
1294 (UserImplicitCast::Resolve): ditto.
1296 2001-09-26 Ravi Pratap <ravi@ximian.com>
1298 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
1299 operator, return after emitting body. Regression tests pass again !
1301 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
1302 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
1303 (Invocation::OverloadResolve): Ditto.
1304 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
1306 * everywhere : update calls to the above methods accordingly.
1308 2001-09-26 Miguel de Icaza <miguel@ximian.com>
1310 * assign.cs (Assign): Make it inherit from ExpressionStatement.
1312 * expression.cs (ExpressionStatement): New base class used for
1313 expressions that can appear in statements, so that we can provide
1314 an alternate path to generate expression that do not leave a value
1317 (Expression::Emit, and all the derivatives): We no longer return
1318 whether a value is left on the stack or not. Every expression
1319 after being emitted leaves a single value on the stack.
1321 * codegen.cs (EmitContext::EmitStatementExpression): Use the
1322 facilties of ExpressionStatement if possible.
1324 * cs-parser.jay: Update statement_expression.
1326 2001-09-25 Miguel de Icaza <miguel@ximian.com>
1328 * driver.cs: Change the wording of message
1330 2001-09-25 Ravi Pratap <ravi@ximian.com>
1332 * expression.cs (Binary::ResolveOperator): Had forgottten to set
1333 the type of the expression to the return type of the method if
1334 we have an overloaded operator match ! The regression tests pass again !
1335 (Unary::ResolveOperator): Ditto.
1337 * expression.cs (Invocation::ConversionExists): Correct the member lookup
1338 to find "op_Implicit", not "implicit" ;-)
1339 (UserImplicitCast): New class to take care of user-defined implicit conversions.
1340 (ConvertImplicit, ForceConversion): Take TypeContainer argument
1342 * everywhere : Correct calls to the above accordingly.
1344 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
1345 (ConvertImplicit): Do user-defined conversion if it exists.
1347 2001-09-24 Miguel de Icaza <miguel@ximian.com>
1349 * assign.cs: track location.
1350 (Resolve): Use implicit conversions on assignment.
1352 * literal.cs: Oops. Not good, Emit of short access values should
1353 pass (Bytes) or the wrong argument will be selected.
1355 * expression.cs (Unary::Emit): Emit code for -expr.
1357 (Unary::ResolveOperator): Handle `Substract' for non-constants
1358 (substract from zero from the non-constants).
1359 Deal with Doubles as well.
1361 (Expression::ConvertImplicitRequired): New routine that reports an
1362 error if no implicit conversion exists.
1364 (Invocation::OverloadResolve): Store the converted implicit
1365 expressions if we make them
1367 2001-09-24 Ravi Pratap <ravi@ximian.com>
1369 * class.cs (ConstructorInitializer): Take a Location argument.
1370 (ConstructorBaseInitializer): Same here.
1371 (ConstructorThisInitializer): Same here.
1373 * cs-parser.jay : Update all calls accordingly.
1375 * expression.cs (Unary, Binary, New): Take location argument.
1376 Update accordingly everywhere.
1378 * cs-parser.jay : Update all calls to the above to take a location
1383 2001-09-24 Ravi Pratap <ravi@ximian.com>
1385 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
1386 (Invocation::BetterConversion): Same here
1387 (Invocation::ConversionExists): Ditto.
1389 (Invocation::ConversionExists): Implement.
1391 2001-09-22 Ravi Pratap <ravi@ximian.com>
1393 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
1394 Also take an additional TypeContainer argument.
1396 * All over : Pass in TypeContainer as argument to OverloadResolve.
1398 * typemanager.cs (CSharpName): Update to check for the string type and return
1401 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
1404 2001-09-21 Ravi Pratap <ravi@ximian.com>
1406 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
1407 (Invocation::BetterFunction): Implement.
1408 (Invocation::BetterConversion): Implement.
1409 (Invocation::ConversionExists): Skeleton, no implementation yet.
1411 Okay, things work fine !
1413 2001-09-21 Miguel de Icaza <miguel@ximian.com>
1415 * typemanager.cs: declare and load enum_type, delegate_type and
1418 * expression.cs (Expression::Emit): Now emit returns a value that
1419 tells whether a value is left on the stack or not. This strategy
1420 might be reveted tomorrow with a mechanism that would address
1421 multiple assignments.
1422 (Expression::report118): Utility routine to report mismatches on
1425 (Unary::Report23): Report impossible type/operator combination
1428 (Unary::IsIncrementableNumber): Whether the type can be
1429 incremented or decremented with add.
1430 (Unary::ResolveOperator): Also allow enumerations to be bitwise
1432 (Unary::ResolveOperator): Implement ++, !, ~, ++ and --.
1434 (Invocation::Emit): Deal with new Emit convetion.
1436 * All Expression derivatives: Updated their Emit method to return
1437 whether they leave values on the stack or not.
1439 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
1440 stack for expressions that are statements.
1442 2001-09-20 Miguel de Icaza <miguel@ximian.com>
1444 * expression.cs (LValue): New interface. Must be implemented by
1446 (LocalVariableReference, ParameterReference, FieldExpr): Implement
1449 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
1450 interface for generating code, simplifies the code.
1452 2001-09-20 Ravi Pratap <ravi@ximian.com>
1454 * expression.cs (everywhere): Comment out return statements in ::Resolve
1455 methods to avoid the warnings.
1457 2001-09-20 Miguel de Icaza <miguel@ximian.com>
1459 * driver.cs (parse): Report error 2001 if we can not open the
1462 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
1465 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
1468 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
1469 otherwise nested blocks end up with the same index.
1471 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
1473 * expression.cs: Instead of having FIXMEs in the Resolve
1474 functions, throw exceptions so it is obvious that we are facing a
1477 * cs-parser.jay (invocation_expression): Pass Location information.
1479 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
1480 Use a basename for those routines because .NET does not like paths
1483 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
1486 2001-09-19 Miguel de Icaza <miguel@ximian.com>
1488 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
1489 are loading the correct data types (throws an exception if not).
1490 (TypeManager::InitCoreTypes): Use CoreLookupType
1492 * expression.cs (Unary::ResolveOperator): return the child
1493 expression for expressions which are just +expr.
1494 (Unary::ResolveOperator): Return negative literals for -LITERAL
1495 expressions (otherwise they are Unary {Literal}).
1496 (Invocation::Badness): Take into account `Implicit constant
1497 expression conversions'.
1499 * literal.cs (LongLiteral): Implement long literal class.
1500 (IntLiteral): export the `Value' of the intliteral.
1502 2001-09-19 Ravi Pratap <ravi@ximian.com>
1504 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
1506 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
1507 instead of 'Operator'
1509 * expression.cs (Binary::ResolveOperator): Update accordingly.
1510 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
1513 * cs-parser.jay (unary_expression): Update to use the new names.
1515 * gen-treedump.cs (GetUnary): Same here.
1517 * expression.cs (Unary::Resolve): Implement.
1518 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
1519 operators are found instead of making noise ;-)
1520 (Unary::ResolveOperator): New method to do precisely the same thing which
1521 Binary::ResolveOperator does for Binary expressions.
1522 (Unary.method, .Arguments): Add.
1523 (Unary::OperName): Implement.
1524 (Unary::ForceConversion): Copy and Paste !
1526 * class.cs (Operator::Define): Fix a small bug for the case when we have
1529 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
1530 for the inbuilt operators. Only overloading works for now ;-)
1532 2001-09-18 Miguel de Icaza <miguel@ximian.com>
1534 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
1535 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
1537 * expression.cs (This::Emit): Implement.
1538 (This::Resolve): Implement.
1539 (TypeOf:Resolve): Implement.
1540 (Expression::ResolveSimpleName): Add an implicit this to instance
1542 (MemberAccess::Resolve): Deal with Parameters and Fields.
1543 Bind instance variable to Field expressions.
1544 (FieldExpr::Instance): New field used to track the expression that
1545 represents the object instance.
1546 (FieldExpr::Resolve): Track potential errors from MemberLookup not
1548 (FieldExpr::Emit): Implement.
1550 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
1551 the last instruction contains a return opcode to avoid generating
1552 the last `ret' instruction (this generates correct code, and it is
1553 nice to pass the peverify output).
1555 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
1556 initializer for static and instance variables.
1557 (Constructor::Emit): Allow initializer to be null in the case of
1558 static constructors. Only emit initializer for instance
1561 (TypeContainer::FindMembers): Return a null array if there are no
1564 Also fix the code for the MemberTypes.Method branch, as it was not
1565 scanning that for operators (or tried to access null variables before).
1567 * assign.cs (Assign::Emit): Handle instance and static fields.
1571 * driver.cs: Stop compilation if there are parse errors.
1573 * cs-parser.jay (constructor_declaration): Provide default base
1574 initializer for non-static constructors.
1575 (constructor_declarator): Do not provide a default base
1576 initializers if none was specified.
1577 Catch the fact that constructors should not have parameters.
1579 * class.cs: Do not emit parent class initializers for static
1580 constructors, that should be flagged as an error.
1582 2001-09-18 Ravi Pratap <ravi@ximian.com>
1584 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
1585 Move back code into TypeContainer::Populate.
1587 2001-09-18 Ravi Pratap <ravi@ximian.com>
1589 * class.cs (TypeContainer::AddConstructor): Fix the check to
1590 compare against Name, not Basename.
1591 (Operator::OpType): Change Plus and Minus to Add and Subtract.
1593 * cs-parser.jay : Update accordingly.
1595 * class.cs (TypeContainer::FindMembers): For the case where we are searching
1596 for methods, don't forget to look into the operators too.
1597 (RegisterMethodBuilder): Helper method to take care of this for
1598 methods, constructors and operators.
1599 (Operator::Define): Completely revamp.
1600 (Operator.OperatorMethod, MethodName): New fields.
1601 (TypeContainer::Populate): Move the registering of builders into
1602 RegisterMethodBuilder.
1603 (Operator::Emit): Re-write.
1605 * expression.cs (Binary::Emit): Comment out code path to emit method
1606 invocation stuff for the case when we have a user defined operator. I am
1607 just not able to get it right !
1609 2001-09-17 Miguel de Icaza <miguel@ximian.com>
1611 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
1614 (Expression::MemberLookup): Provide a version that allows to
1615 specify the MemberTypes and BindingFlags.
1617 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
1618 so it was not fetching variable information from outer blocks.
1620 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
1621 Beforefieldinit as it was buggy.
1623 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
1626 * class.cs (Constructor::Emit): Only emit if block is not null.
1627 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
1628 deal with this by semantically definining it as if the user had
1631 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
1632 constructors as we now "emit" them at a higher level.
1634 (TypeContainer::DefineDefaultConstructor): Used to define the
1635 default constructors if none was provided.
1637 (ConstructorInitializer): Add methods Resolve and Emit.
1639 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
1641 2001-09-17 Ravi Pratap <ravi@ximian.com>
1643 * class.cs (TypeContainer::EmitDefaultConstructor): Register
1644 the default constructor builder with our hashtable for methodbuilders
1647 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
1648 and argument_count is 0 in which case we have a match.
1649 (Binary::ResolveOperator): More null checking and miscellaneous coding
1652 2001-09-17 Ravi Pratap <ravi@ximian.com>
1654 * rootcontext.cs (IsNameSpace): Compare against null.
1656 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
1658 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
1659 and Unary::Operator.
1661 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
1664 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
1665 we have overloaded operators.
1666 (Binary::ResolveOperator): Implement the part which does the operator overload
1669 * class.cs (Operator::Emit): Implement.
1670 (TypeContainer::Emit): Emit the operators we have too.
1672 * expression.cs (Binary::Emit): Update to emit the appropriate code for
1673 the case when we have a user-defined operator.
1675 2001-09-17 Miguel de Icaza <miguel@ximian.com>
1677 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
1679 2001-09-16 Ravi Pratap <ravi@ximian.com>
1681 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
1682 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
1683 (Constructor::Emit): Implement.
1684 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
1685 if we have no work to do.
1686 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
1689 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
1690 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
1692 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
1695 2001-09-15 Ravi Pratap <ravi@ximian.com>
1697 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
1699 (Tree::RecordNamespace): Method to do what the name says ;-)
1700 (Tree::Namespaces): Property to get at the namespaces hashtable.
1702 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
1705 * rootcontext.cs (IsNamespace): Fixed it :-)
1707 2001-09-14 Miguel de Icaza <miguel@ximian.com>
1709 * class.cs (TypeContainer::FindMembers): Add support for
1711 (MethodCore): New class that encapsulates both the shared aspects
1712 of a Constructor and a Method.
1713 (Method, Constructor): Factored pieces into MethodCore.
1715 * driver.cs: Added --fatal which makes errors throw exceptions.
1716 Load System assembly as well as part of the standard library.
1718 * report.cs: Allow throwing exceptions on errors for debugging.
1720 * modifiers.cs: Do not use `parent', instead use the real type
1721 container to evaluate permission settings.
1723 * class.cs: Put Ravi's patch back in. He is right, and we will
1724 have to cope with the
1726 2001-09-14 Ravi Pratap <ravi@ximian.com>
1728 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
1729 FamORAssem, not FamANDAssem.
1731 2001-09-14 Miguel de Icaza <miguel@ximian.com>
1733 * driver.cs: Added --parse option that only parses its input files
1736 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
1737 incorrect. IsTopLevel is not used to tell whether an object is
1738 root_types or not (that can be achieved by testing this ==
1739 root_types). But to see if this is a top-level *class* (not
1740 necessarly our "toplevel" container).
1742 2001-09-14 Ravi Pratap <ravi@ximian.com>
1744 * enum.cs (Enum::Define): Modify to call the Lookup method on the
1745 parent instead of a direct call to GetType.
1747 2001-09-14 Ravi Pratap <ravi@ximian.com>
1749 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
1750 Modifiers.TypeAttr. This should just be a call to that method.
1752 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
1753 object so that we can determine if we are top-level or not.
1755 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
1758 * enum.cs (Enum::Define): Ditto.
1760 * modifiers.cs (FieldAttr): Re-write.
1762 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
1763 (TypeContainer::HaveStaticConstructor): New property to provide access
1764 to precisely that info.
1766 * modifiers.cs (MethodAttr): Re-write.
1767 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
1769 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
1770 of top-level types as claimed.
1772 2001-09-13 Miguel de Icaza <miguel@ximian.com>
1774 * expression.cs (MemberLookup): Fruitless attempt to lookup
1775 constructors. Maybe I need to emit default constructors? That
1776 might be it (currently .NET emits this for me automatically).
1777 (Invocation::OverloadResolve): Cope with Arguments == null.
1778 (Invocation::EmitArguments): new function, shared by the new
1780 (Invocation::Emit): Handle static and instance methods. Emit
1781 proper call instruction for virtual or non-virtual invocations.
1782 (New::Emit): Implement.
1783 (New::Resolve): Implement.
1784 (MemberAccess:Resolve): Implement.
1785 (MethodGroupExpr::InstanceExpression): used conforming to the spec
1787 (FieldExpr::Resolve): Set type.
1789 * support.cs: Handle empty arguments.
1791 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
1792 SimpleLookup): Auxiliary routines to help parse a qualifier
1795 Update qualifier_identifier rule.
1797 * codegen.cs: Removed debugging messages.
1799 * class.cs: Make this a global thing, this acts just as a "key" to
1800 objects that we might have around.
1802 (Populate): Only initialize method_builders_to_methods once.
1804 * expression.cs (PropertyExpr): Initialize type from the
1807 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
1808 Resolve pattern. Attempt to implicitly convert value to boolean.
1811 * expression.cs: Set the type for the int32/int32 argument case.
1812 (Binary::ResolveOperator): Set the return type to boolean for
1813 comparission operators
1815 * typemanager.cs: Remove debugging print code.
1817 (Invocation::Resolve): resolve type.
1819 * class.cs: Allocate a MemberInfo of the correct size, as the code
1820 elsewhere depends on the test to reflect the correct contents.
1822 (Method::) Keep track of parameters, due to System.Reflection holes
1824 (TypeContainer::Populate): Keep track of MethodBuilders to Method
1827 (TypeContainer::FindMembers): Use ArrayList and then copy an array
1828 of the exact size and return that.
1830 (Class::LookupMethodByBuilder): New function that maps
1831 MethodBuilders to its methods. Required to locate the information
1832 on methods because System.Reflection bit us again.
1834 * support.cs: New file, contains an interface ParameterData and
1835 two implementations: ReflectionParameters and InternalParameters
1836 used to access Parameter information. We will need to grow this
1839 * expression.cs (Invocation::GetParameterData): implement a cache
1840 and a wrapper around the ParameterData creation for methods.
1841 (Invocation::OverloadResolve): Use new code.
1843 2001-09-13 Ravi Pratap <ravi@ximian.com>
1845 * class.cs (TypeContainer::EmitField): Remove and move into
1846 (Field::Define): here and modify accordingly.
1847 (Field.FieldBuilder): New member.
1848 (TypeContainer::Populate): Update accordingly.
1849 (TypeContainer::FindMembers): Implement.
1851 2001-09-13 Miguel de Icaza <miguel@ximian.com>
1853 * statement.cs: (VariableInfo::VariableType): New field to be
1854 initialized with the full type once it is resolved.
1856 2001-09-12 Miguel de Icaza <miguel@ximian.com>
1858 * parameter.cs (GetParameterInfo): Use a type cache to compute
1859 things only once, and to reuse this information
1861 * expression.cs (LocalVariableReference::Emit): Implement.
1862 (OpcodeCast::Emit): fix.
1864 (ParameterReference::Resolve): Implement.
1865 (ParameterReference::Emit): Implement.
1867 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
1868 that are expressions need to stay as Expressions.
1870 * typemanager.cs (CSharpName): Returns the C# name of a type if
1873 * expression.cs (Expression::ConvertImplicit): New function that
1874 implements implicit type conversions.
1876 (Expression::ImplicitReferenceConversion): Implements implicit
1877 reference conversions.
1879 (EmptyCast): New type for transparent casts.
1881 (OpcodeCast): New type for casts of types that are performed with
1882 a sequence of bytecodes.
1884 (BoxedCast): New type used for casting value types into reference
1885 types. Emits a box opcode.
1887 (Binary::DoNumericPromotions): Implements numeric promotions of
1888 and computation of the Binary::Type.
1890 (Binary::EmitBranchable): Optimization.
1892 (Binary::Emit): Implement code emission for expressions.
1894 * typemanager.cs (TypeManager): Added two new core types: sbyte
1897 2001-09-12 Ravi Pratap <ravi@ximian.com>
1899 * class.cs (TypeContainer::FindMembers): Method which does exactly
1900 what Type.FindMembers does, only we don't have to use reflection. No
1903 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
1904 typecontainer objects as we need to get at them.
1905 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
1907 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
1908 typecontainer object.
1910 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
1911 of just a Report object.
1913 2001-09-11 Ravi Pratap <ravi@ximian.com>
1915 * class.cs (Event::Define): Go back to using the prefixes "add_" and
1917 (TypeContainer::Populate): Now define the delegates of the type too.
1918 (TypeContainer.Delegates): Property to access the list of delegates defined
1921 * delegates.cs (Delegate::Define): Implement partially.
1923 * modifiers.cs (TypeAttr): Handle more flags.
1925 2001-09-11 Ravi Pratap <ravi@ximian.com>
1927 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
1929 (Operator::Define): Re-write logic to get types by using the LookupType method
1930 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
1931 (Indexer::Define): Ditto.
1932 (Event::Define): Ditto.
1933 (Property::Define): Ditto.
1935 2001-09-10 Ravi Pratap <ravi@ximian.com>
1937 * class.cs (TypeContainer::Populate): Now define operators too.
1938 (TypeContainer.Operators): New property to access the list of operators
1940 (Operator.OperatorMethodBuilder): New member to hold the method builder
1941 for the operator we are defining.
1942 (Operator::Define): Implement.
1944 2001-09-10 Ravi Pratap <ravi@ximian.com>
1946 * class.cs (Event::Define): Make the prefixes of the accessor methods
1947 addOn_ and removeOn_
1949 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
1950 of the location being passed in too. Ideally, this should go later since all
1951 error reporting should be done through the Report object.
1953 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
1954 (Populate): Iterate thru the indexers we have and define them too.
1955 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
1956 for the get and set accessors.
1957 (Indexer::Define): Implement.
1959 2001-09-09 Miguel de Icaza <miguel@ximian.com>
1961 * expression.cs (Binary::Resolve): Beginning of it. I scratched
1962 my previous implementation, did not work.
1964 * typemanager.cs: Add a couple of missing types (the longs).
1966 * literal.cs: Use TypeManager.bool_type instead of getting it.
1968 * expression.cs (EventExpr): New kind of expressions.
1969 (Expressio::ExprClassFromMemberInfo): finish
1971 2001-09-08 Miguel de Icaza <miguel@ximian.com>
1973 * assign.cs: Emit stores to static fields differently.
1975 2001-09-08 Ravi Pratap <ravi@ximian.com>
1977 * Merge in changes and adjust code to tackle conflicts. Backed out my
1978 code in Assign::Resolve ;-)
1980 2001-09-08 Ravi Pratap <ravi@ximian.com>
1982 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
1983 instead Report.Error and also pass in the location.
1984 (CSharpParser::Lexer): New readonly property to return the reference
1985 to the Tokenizer object.
1986 (declare_local_variables): Use Report.Error with location instead of plain
1990 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
1991 (Operator.CheckBinaryOperator): Ditto.
1993 * cs-parser.jay (operator_declarator): Update accordingly.
1995 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
1996 (CheckBinaryOperator): Same here.
1998 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
1999 on the name without any prefixes of namespace names etc. This is because we
2000 already might have something already fully qualified like
2001 'System.Console.WriteLine'
2003 * assign.cs (Resolve): Begin implementation. Stuck ;-)
2005 2001-09-07 Ravi Pratap <ravi@ximian.com>
2007 * cs-tokenizer.cs (location): Return a string which also contains
2010 * expression.cs (ElementAccess): New class for expressions of the
2011 type 'element access.'
2012 (BaseAccess): New class for expressions of the type 'base access.'
2013 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
2016 * cs-parser.jay (element_access): Implement action.
2017 (base_access): Implement actions.
2018 (checked_expression, unchecked_expression): Implement.
2020 * cs-parser.jay (local_variable_type): Correct and implement.
2021 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
2023 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
2025 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
2026 name and the specifiers.
2028 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
2030 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
2031 making them all public ;-)
2033 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
2036 2001-09-07 Miguel de Icaza <miguel@ximian.com>
2038 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
2040 (FieldExpr, PropertyExprs): New resolved expressions.
2041 (SimpleName::MemberStaticCheck): Perform static checks for access
2042 to non-static fields on static methods. Maybe this should be
2043 generalized for MemberAccesses.
2044 (SimpleName::ResolveSimpleName): More work on simple name
2047 * cs-parser.jay (primary_expression/qualified_identifier): track
2048 the parameter index.
2050 * codegen.cs (CodeGen::Save): Catch save exception, report error.
2051 (EmitContext::EmitBoolExpression): Chain to expression generation
2052 instead of temporary hack.
2053 (::EmitStatementExpression): Put generic expression code generation.
2055 * assign.cs (Assign::Emit): Implement variable assignments to
2056 local variables, parameters and fields.
2058 2001-09-06 Miguel de Icaza <miguel@ximian.com>
2060 * statement.cs (Block::GetVariableInfo): New method, returns the
2061 VariableInfo for a variable name in a block.
2062 (Block::GetVariableType): Implement in terms of GetVariableInfo
2064 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
2065 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
2067 2001-09-06 Ravi Pratap <ravi@ximian.com>
2069 * cs-parser.jay (operator_declaration): Continue on my quest : update
2070 to take attributes argument.
2071 (event_declaration): Ditto.
2072 (enum_declaration): Ditto.
2073 (indexer_declaration): Ditto.
2075 * class.cs (Operator::Operator): Update constructor accordingly.
2076 (Event::Event): Ditto.
2078 * delegate.cs (Delegate::Delegate): Same here.
2080 * enum.cs (Enum::Enum): Same here.
2082 2001-09-05 Ravi Pratap <ravi@ximian.com>
2084 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
2086 * ../tests/cs0658.cs : New file to demonstrate error 0658.
2088 * attribute.cs (Attributes): New class to encapsulate all attributes which were
2089 being passed around as an arraylist.
2090 (Attributes::AddAttribute): Method to add attribute sections.
2092 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
2093 (struct_declaration): Update accordingly.
2094 (constant_declaration): Update.
2095 (field_declaration): Update.
2096 (method_header): Update.
2097 (fixed_parameter): Update.
2098 (parameter_array): Ditto.
2099 (property_declaration): Ditto.
2100 (destructor_declaration): Ditto.
2102 * class.cs (Struct::Struct): Update constructors accordingly.
2103 (Class::Class): Ditto.
2104 (Field::Field): Ditto.
2105 (Method::Method): Ditto.
2106 (Property::Property): Ditto.
2107 (TypeContainer::OptAttribute): update property's return type.
2109 * interface.cs (Interface.opt_attributes): New member.
2110 (Interface::Interface): Update to take the extra Attributes argument.
2112 * parameter.cs (Parameter::Parameter): Ditto.
2114 * constant.cs (Constant::Constant): Ditto.
2116 * interface.cs (InterfaceMemberBase): New OptAttributes field.
2117 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
2118 the attributes as a parameter.
2119 (InterfaceProperty): Update constructor call.
2120 (InterfaceEvent): Ditto.
2121 (InterfaceMethod): Ditto.
2122 (InterfaceIndexer): Ditto.
2124 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
2125 pass the attributes too.
2126 (interface_event_declaration): Ditto.
2127 (interface_property_declaration): Ditto.
2128 (interface_method_declaration): Ditto.
2129 (interface_declaration): Ditto.
2131 2001-09-05 Miguel de Icaza <miguel@ximian.com>
2133 * class.cs (Method::Define): Track the "static Main" definition to
2134 create an entry point.
2136 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
2137 EntryPoint if we find it.
2139 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
2140 (EmitContext::ig): Make this variable public.
2142 * driver.cs: Make the default output file be the first file name
2143 with the .exe extension.
2145 Detect empty compilations
2147 Handle various kinds of output targets. Handle --target and
2148 rename -t to --dumper.
2150 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
2151 methods inherited from Expression return now an Expression. This
2152 will is used during the tree rewriting as we resolve them during
2155 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
2156 the spec. Missing entirely is the information about
2157 accessability of elements of it.
2159 (Expression::ExprClassFromMemberInfo): New constructor for
2160 Expressions that creates a fully initialized Expression based on
2161 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
2164 (Invocation::Resolve): Begin implementing resolution of invocations.
2166 * literal.cs (StringLiteral): Implement Emit.
2168 2001-09-05 Ravi Pratap <ravi@ximian.com>
2170 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
2173 2001-09-04 Ravi Pratap <ravi@ximian.com>
2175 * cs-parser.jay (attribute_arguments): Implement actions.
2176 (attribute): Fix bug in production. Implement action.
2177 (attribute_list): Implement.
2178 (attribute_target): Implement.
2179 (attribute_target_specifier, opt_target_specifier): Implement
2180 (CheckAttributeTarget): New method to check if the attribute target
2182 (attribute_section): Implement.
2183 (opt_attributes): Implement.
2185 * attribute.cs : New file to handle attributes.
2186 (Attribute): Class to hold attribute info.
2188 * cs-parser.jay (opt_attribute_target_specifier): Remove production
2189 (attribute_section): Modify production to use 2 different rules to
2190 achieve the same thing. 1 s/r conflict down !
2191 Clean out commented, useless, non-reducing dimension_separator rules.
2193 * class.cs (TypeContainer.attributes): New member to hold list
2194 of attributes for a type.
2195 (Struct::Struct): Modify to take one more argument, the attribute list.
2196 (Class::Class): Ditto.
2197 (Field::Field): Ditto.
2198 (Method::Method): Ditto.
2199 (Property::Property): Ditto.
2201 * cs-parser.jay (struct_declaration): Update constructor call to
2202 pass in the attributes too.
2203 (class_declaration): Ditto.
2204 (constant_declaration): Ditto.
2205 (field_declaration): Ditto.
2206 (method_header): Ditto.
2207 (fixed_parameter): Ditto.
2208 (parameter_array): Ditto.
2209 (property_declaration): Ditto.
2211 * constant.cs (Constant::Constant): Update constructor similarly.
2212 Use System.Collections.
2214 * parameter.cs (Parameter::Parameter): Update as above.
2216 2001-09-02 Ravi Pratap <ravi@ximian.com>
2218 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
2219 (TypeContainer.delegates): New member to hold list of delegates.
2221 * cs-parser.jay (delegate_declaration): Implement the action correctly
2222 this time as I seem to be on crack ;-)
2224 2001-09-02 Miguel de Icaza <miguel@ximian.com>
2226 * rootcontext.cs (RootContext::IsNamespace): new function, used to
2227 tell whether an identifier represents a namespace.
2229 * expression.cs (NamespaceExpr): A namespace expression, used only
2230 temporarly during expression resolution.
2231 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
2232 utility functions to resolve names on expressions.
2234 2001-09-01 Miguel de Icaza <miguel@ximian.com>
2236 * codegen.cs: Add hook for StatementExpressions.
2238 * class.cs: Fix inverted test for static flag in methods.
2240 2001-09-02 Ravi Pratap <ravi@ximian.com>
2242 * class.cs (Operator::CheckUnaryOperator): Correct error number used
2243 to make it coincide with MS' number.
2244 (Operator::CheckBinaryOperator): Ditto.
2246 * ../errors/errors.txt : Remove error numbers added earlier.
2248 * ../errors/cs1019.cs : Test case for error # 1019
2250 * ../errros/cs1020.cs : Test case for error # 1020
2252 * cs-parser.jay : Clean out commented cruft.
2253 (dimension_separators, dimension_separator): Comment out. Ostensibly not
2254 used anywhere - non-reducing rule.
2255 (namespace_declarations): Non-reducing rule - comment out.
2257 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
2258 with TypeContainer::AddEnum.
2260 * delegate.cs : New file for delegate handling classes.
2261 (Delegate): Class for declaring delegates.
2263 * makefile : Update.
2265 * cs-parser.jay (delegate_declaration): Implement.
2267 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
2269 * class.cs (Event::Define): Implement.
2270 (Event.EventBuilder): New member.
2272 * class.cs (TypeContainer::Populate): Update to define all enums and events
2274 (Events): New property for the events arraylist we hold. Shouldn't we move to using
2275 readonly fields for all these cases ?
2277 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
2279 * class.cs (Property): Revamp to use the convention of making fields readonly.
2280 Accordingly modify code elsewhere.
2282 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
2283 the Define method of the Property class.
2285 * class.cs : Clean up applied patch and update references to variables etc. Fix
2287 (TypeContainer::Populate): Update to define all the properties we have. Also
2288 define all enumerations.
2290 * enum.cs (Define): Implement.
2292 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
2294 * cs-parser.jay (overloadable_operator): The semantic value is an
2295 enum of the Operator class.
2296 (operator_declarator): Implement actions.
2297 (operator_declaration): Implement.
2299 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
2300 validity of definitions.
2301 (Operator::CheckBinaryOperator): Static method to check for binary operators
2302 (TypeContainer::AddOperator): New method to add an operator to a type.
2304 * cs-parser.jay (indexer_declaration): Added line to actually call the
2305 AddIndexer method so it gets added ;-)
2307 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
2308 already taken care of by the MS compiler ?
2310 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
2312 * class.cs (Operator): New class for operator declarations.
2313 (Operator::OpType): Enum for the various operators.
2315 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
2317 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
2318 ostensibly handle this in semantic analysis.
2320 * cs-parser.jay (general_catch_clause): Comment out
2321 (specific_catch_clauses, specific_catch_clause): Ditto.
2322 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
2323 (catch_args, opt_catch_args): New productions.
2324 (catch_clause): Rewrite to use the new productions above
2325 (catch_clauses): Modify accordingly.
2326 (opt_catch_clauses): New production to use in try_statement
2327 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
2328 and re-write the code in the actions to extract the specific and
2329 general catch clauses by being a little smart ;-)
2331 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
2332 Hooray, try and catch statements parse fine !
2334 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
2336 * statement.cs (Block::GetVariableType): Fix logic to extract the type
2337 string from the hashtable of variables.
2339 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
2340 I end up making that mistake ;-)
2341 (catch_clauses): Fixed gross error which made Key and Value of the
2342 DictionaryEntry the same : $1 !!
2344 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
2346 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
2348 * cs-parser.jay (event_declaration): Correct to remove the semicolon
2349 when the add and remove accessors are specified.
2351 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
2353 * cs-parser.jay (IndexerDeclaration): New helper class to hold
2354 information about indexer_declarator.
2355 (indexer_declarator): Implement actions.
2356 (parsing_indexer): New local boolean used to keep track of whether
2357 we are parsing indexers or properties. This is necessary because
2358 implicit_parameters come into picture even for the get accessor in the
2360 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
2362 * class.cs (Indexer): New class for indexer declarations.
2363 (TypeContainer::AddIndexer): New method to add an indexer to a type.
2364 (TypeContainer::indexers): New member to hold list of indexers for the
2367 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
2369 * cs-parser.jay (add_accessor_declaration): Implement action.
2370 (remove_accessor_declaration): Implement action.
2371 (event_accessors_declaration): Implement
2372 (variable_declarators): swap statements for first rule - trivial.
2374 * class.cs (Event): New class to hold information about event
2376 (TypeContainer::AddEvent): New method to add an event to a type
2377 (TypeContainer::events): New member to hold list of events.
2379 * cs-parser.jay (event_declaration): Implement actions.
2381 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
2383 * cs-parser.jay (dim_separators): Implement. Make it a string
2384 concatenating all the commas together, just as they appear.
2385 (opt_dim_separators): Modify accordingly
2386 (rank_specifiers): Update accordingly. Basically do the same
2387 thing - instead, collect the brackets here.
2388 (opt_rank_sepcifiers): Modify accordingly.
2389 (array_type): Modify to actually return the complete type string
2390 instead of ignoring the rank_specifiers.
2391 (expression_list): Implement to collect the expressions
2392 (variable_initializer): Implement. We make it a list of expressions
2393 essentially so that we can handle the array_initializer case neatly too.
2394 (variable_initializer_list): Implement.
2395 (array_initializer): Make it a list of variable_initializers
2396 (opt_array_initializer): Modify accordingly.
2398 * expression.cs (New::NType): Add enumeration to help us
2399 keep track of whether we have an object/delegate creation
2400 or an array creation.
2401 (New:NewType, New::Rank, New::Indices, New::Initializers): New
2402 members to hold data about array creation.
2403 (New:New): Modify to update NewType
2404 (New:New): New Overloaded contructor for the array creation
2407 * cs-parser.jay (array_creation_expression): Implement to call
2408 the overloaded New constructor.
2410 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
2412 * class.cs (TypeContainer::Constructors): Return member
2413 constructors instead of returning null.
2415 2001-08-26 Miguel de Icaza <miguel@ximian.com>
2417 * typemanager.cs (InitCoreTypes): Initialize the various core
2418 types after we have populated the type manager with the user
2419 defined types (this distinction will be important later while
2420 compiling corlib.dll)
2422 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
2423 on Expression Classification. Now all expressions have a method
2424 `Resolve' and a method `Emit'.
2426 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
2427 generation from working. Also add some temporary debugging
2430 2001-08-24 Miguel de Icaza <miguel@ximian.com>
2432 * codegen.cs: Lots of code generation pieces. This is only the
2433 beginning, will continue tomorrow with more touches of polish. We
2434 handle the fundamentals of if, while, do, for, return. Others are
2435 trickier and I need to start working on invocations soon.
2437 * gen-treedump.cs: Bug fix, use s.Increment here instead of
2440 * codegen.cs (EmitContext): New struct, used during code
2441 emission to keep a context. Most of the code generation will be
2444 * cs-parser.jay: Add embedded blocks to the list of statements of
2445 this block. So code generation proceeds in a top down fashion.
2447 2001-08-23 Miguel de Icaza <miguel@ximian.com>
2449 * statement.cs: Add support for multiple child blocks.
2451 2001-08-22 Miguel de Icaza <miguel@ximian.com>
2453 * codegen.cs (EmitCode): New function, will emit the code for a
2454 Block of code given a TypeContainer and its ILGenerator.
2456 * statement.cs (Block): Standard public readonly optimization.
2457 (Block::Block constructors): Link children.
2458 (Block::Child): Child Linker.
2459 (Block::EmitVariables): Emits IL variable declarations.
2461 * class.cs: Drop support for MethodGroups here, delay until
2463 (Method::): Applied the same simplification that I did before, and
2464 move from Properties to public readonly fields.
2465 (Method::ParameterTypes): Returns the parameter types for the
2466 function, and implements a cache that will be useful later when I
2467 do error checking and the semantic analysis on the methods is
2469 (Constructor::GetCallingConvention): Renamed from CallingConvetion
2470 and made a method, optional argument tells whether this is a class
2471 or a structure to apply the `has-this' bit.
2472 (Method::GetCallingConvention): Implement, returns the calling
2474 (Method::Define): Defines the type, a second pass is performed
2475 later to populate the methods.
2477 (Constructor::ParameterTypes): implement a cache similar to the
2478 one on Method::ParameterTypes, useful later when we do semantic
2481 (TypeContainer::EmitMethod): New method. Emits methods.
2483 * expression.cs: Removed MethodGroup class from here.
2485 * parameter.cs (Parameters::GetCallingConvention): new method.
2487 2001-08-21 Miguel de Icaza <miguel@ximian.com>
2489 * class.cs (TypeContainer::Populate): Drop RootContext from the
2492 (Constructor::CallingConvention): Returns the calling convention.
2493 (Constructor::ParameterTypes): Returns the constructor parameter
2496 (TypeContainer::AddConstructor): Keep track of default constructor
2497 and the default static constructor.
2499 (Constructor::) Another class that starts using `public readonly'
2500 instead of properties.
2502 (Constructor::IsDefault): Whether this is a default constructor.
2504 (Field::) use readonly public fields instead of properties also.
2506 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
2507 track of static constructors; If none is used, turn on
2508 BeforeFieldInit in the TypeAttributes.
2510 * cs-parser.jay (opt_argument_list): now the return can be null
2511 for the cases where there are no arguments.
2513 (constructor_declarator): If there is no implicit `base' or
2514 `this', then invoke the default parent constructor.
2516 * modifiers.cs (MethodAttr): New static function maps a set of
2517 modifiers flags into a MethodAttributes enum
2518 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
2519 MethodAttr, TypeAttr to represent the various mappings where the
2521 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
2523 2001-08-19 Miguel de Icaza <miguel@ximian.com>
2525 * parameter.cs (GetParameterInfo): Fix bug where there would be no
2528 * interface.cs (PopulateIndexer): Implemented the code generator
2529 for interface indexers.
2531 2001-08-17 Miguel de Icaza <miguel@ximian.com>
2533 * interface.cs (InterfaceMemberBase): Now we track the new status
2536 (PopulateProperty): Implement property population. Woohoo! Got
2537 Methods and Properties going today.
2539 Removed all the properties for interfaces, and replaced them with
2540 `public readonly' fields.
2542 2001-08-16 Miguel de Icaza <miguel@ximian.com>
2544 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
2545 initialize their hashtables/arraylists only when they are needed
2546 instead of doing this always.
2548 * parameter.cs: Handle refs and out parameters.
2550 * cs-parser.jay: Use an ArrayList to construct the arguments
2551 instead of the ParameterCollection, and then cast that to a
2554 * parameter.cs: Drop the use of ParameterCollection and use
2555 instead arrays of Parameters.
2557 (GetParameterInfo): Use the Type, not the Name when resolving
2560 2001-08-13 Miguel de Icaza <miguel@ximian.com>
2562 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
2563 and instead use public readonly fields.
2565 * class.cs: Put back walking code for type containers.
2567 2001-08-11 Miguel de Icaza <miguel@ximian.com>
2569 * class.cs (MakeConstant): Code to define constants.
2571 * rootcontext.cs (LookupType): New function. Used to locate types
2574 2001-08-08 Miguel de Icaza <miguel@ximian.com>
2576 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
2577 this System.Reflection code is. Kudos to Microsoft
2579 * typemanager.cs: Implement a type cache and avoid loading all
2580 types at boot time. Wrap in LookupType the internals. This made
2581 the compiler so much faster. Wow. I rule!
2583 * driver.cs: Make sure we always load mscorlib first (for
2584 debugging purposes, nothing really important).
2586 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
2587 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
2589 * rootcontext.cs: Lookup types on their namespace; Lookup types
2590 on namespaces that have been imported using the `using' keyword.
2592 * class.cs (TypeContainer::TypeAttr): Virtualize.
2593 (Class::TypeAttr): Return attributes suitable for this bad boy.
2594 (Struct::TypeAttr): ditto.
2595 Handle nested classes.
2596 (TypeContainer::) Remove all the type visiting code, it is now
2597 replaced with the rootcontext.cs code
2599 * rootcontext.cs (GetClassBases): Added support for structs.
2601 2001-08-06 Miguel de Icaza <miguel@ximian.com>
2603 * interface.cs, statement.cs, class.cs, parameter.cs,
2604 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
2605 Drop use of TypeRefs, and use strings instead.
2607 2001-08-04 Miguel de Icaza <miguel@ximian.com>
2611 * class.cs (Struct::Struct): set the SEALED flags after
2612 checking the modifiers.
2613 (TypeContainer::TypeAttr): new property, returns the
2614 TypeAttributes for a class.
2616 * cs-parser.jay (type_list): Oops, list production was creating a
2617 new list of base types.
2619 * rootcontext.cs (StdLib): New property.
2620 (GetInterfaceTypeByName): returns an interface by type name, and
2621 encapsulates error handling here.
2622 (GetInterfaces): simplified.
2623 (ResolveTree): Encapsulated all the tree resolution here.
2624 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
2627 * driver.cs: Add support for --nostdlib, to avoid loading the
2629 (Main): Do not put tree resolution here.
2631 * rootcontext.cs: Beginning of the class resolution.
2633 2001-08-03 Miguel de Icaza <miguel@ximian.com>
2635 * rootcontext.cs: Provide better error reporting.
2637 * cs-parser.jay (interface_base): set our $$ to be interfaces.
2639 * rootcontext.cs (CreateInterface): Handle the case where there
2640 are no parent interfaces.
2642 (CloseTypes): Routine to flush types at the end.
2643 (CreateInterface): Track types.
2644 (GetInterfaces): Returns an array of Types from the list of
2647 * typemanager.c (AddUserType): Mechanism to track user types (puts
2648 the type on the global type hash, and allows us to close it at the
2651 2001-08-02 Miguel de Icaza <miguel@ximian.com>
2653 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
2654 RecordInterface instead.
2656 * cs-parser.jay: Updated to reflect changes above.
2658 * decl.cs (Definition): Keep track of the TypeBuilder type that
2659 represents this type here. Not sure we will use it in the long
2660 run, but wont hurt for now.
2662 * driver.cs: Smaller changes to accomodate the new code.
2664 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
2667 * rootcontext.cs (CreateInterface): New method, used to create
2668 the System.TypeBuilder type for interfaces.
2669 (ResolveInterfaces): new entry point to resolve the interface
2671 (CodeGen): Property, used to keep track of the code generator.
2673 2001-07-26 Miguel de Icaza <miguel@ximian.com>
2675 * cs-parser.jay: Add a second production for delegate_declaration
2678 (enum_body): Put an opt_comma here instead of putting it on
2679 enum_body or enum_member_declarations so we can handle trailing
2680 commas on enumeration members. Gets rid of a shift/reduce.
2682 (type_list): Need a COMMA in the middle.
2684 (indexer_declaration): Tell tokenizer to recognize get/set
2686 * Remove old targets.
2688 * Re-add the parser target.
2690 2001-07-13 Simon Cozens <simon@simon-cozens.org>
2692 * cs-parser.jay: Add precendence rules for a number of operators
2693 ot reduce the number of shift/reduce conflicts in the grammar.
2695 2001-07-17 Miguel de Icaza <miguel@ximian.com>
2697 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
2700 Get rid of old crufty code.
2702 * rootcontext.cs: Use this to keep track of the parsed
2703 representation and the defined types available to the program.
2705 * gen-treedump.cs: adjust for new convention.
2707 * type.cs: Split out the type manager, and the assembly builder
2710 * typemanager.cs: the type manager will live here now.
2712 * cil-codegen.cs: And the code generator here.
2714 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
2716 * makefile: Fixed up for easy making.
2718 2001-07-13 Simon Cozens <simon@simon-cozens.org>
2720 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
2723 (unary_expression): Expand pre_increment_expression and
2724 post_decrement_expression to reduce a shift/reduce.
2726 2001-07-11 Simon Cozens
2728 * cs-tokenizer.cs: Hex numbers should begin with a 0.
2730 Improve allow_keyword_as_indent name.
2732 2001-06-19 Miguel de Icaza <miguel@ximian.com>
2734 * Adjustments for Beta2.
2736 2001-06-13 Miguel de Icaza <miguel@ximian.com>
2738 * decl.cs: Added `Define' abstract method.
2739 (InTransit): new property, used to catch recursive definitions.
2741 * interface.cs: Implement `Define'.
2743 * modifiers.cs: Map Modifiers.constants to
2744 System.Reflection.TypeAttribute flags.
2746 * class.cs: Keep track of types and user-defined types.
2747 (BuilderInit): New method for creating an assembly
2748 (ResolveType): New function to launch the resolution process, only
2749 used by interfaces for now.
2751 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
2752 that are inserted into the name space.
2754 2001-06-08 Miguel de Icaza <miguel@ximian.com>
2756 * ARGH. I have screwed up my tree so many times due to the use of
2757 rsync rather than using CVS. Going to fix this at once.
2759 * driver.cs: Objetify driver. Load assemblies, use assemblies to
2762 2001-06-07 Miguel de Icaza <miguel@ximian.com>
2764 * Experiment successful: Use System.Type rather that our own
2767 2001-05-25 Miguel de Icaza <miguel@ximian.com>
2769 * cs-parser.jay: Removed nsAliases from here.
2771 Use new namespaces, handle `using XXX;'
2773 * namespace.cs: Reimplemented namespace handling, use a recursive
2774 definition of the class. Now we can keep track of using clauses
2775 and catch invalid using clauses.
2777 2001-05-24 Miguel de Icaza <miguel@ximian.com>
2779 * gen-treedump.cs: Adapted for all the renaming.
2781 * expression.cs (Expression): this class now has a Type property
2782 which returns an expression Type.
2784 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
2785 `Type', as this has a different meaning now in the base
2787 2001-05-22 Miguel de Icaza <miguel@ximian.com>
2789 * interface.cs, class.cs: Removed from all the sources the
2790 references to signature computation, as we can not do method
2791 signature computation during the parsing time, as we are not
2792 trying to solve at that point distinguishing:
2796 void a (NS.Blah x) {}
2799 Which depending on the context might be valid or not, as we do not
2800 know if Blah is the same thing as NS.Blah at that point.
2802 * Redid everything so the code uses TypeRefs now instead of
2803 Types. TypeRefs are just temporary type placeholders, that need
2804 to be resolved. They initially have a pointer to a string and the
2805 current scope in which they are used. This is used later by the
2806 compiler to resolve the reference to an actual Type.
2808 * DeclSpace is no longer a CIR.Type, and neither are
2809 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
2810 are all DeclSpaces, but no Types.
2812 * type.cs (TypeRefManager): This implements the TypeRef manager,
2813 which keeps track of all the types that need to be resolved after
2814 the parsing has finished.
2816 2001-05-13 Miguel de Icaza <miguel@ximian.com>
2818 * ARGH. We are going to have to store `foreach' as a class rather
2819 than resolving it, as we need to verify error 1579 after name
2820 resolution. *OR* we could keep a flag that says `This request to
2821 IEnumerator comes from a foreach statement' which we can then use
2822 to generate the error.
2824 2001-05-10 Miguel de Icaza <miguel@ximian.com>
2826 * class.cs (TypeContainer.AddMethod): we now add methods to the
2827 MethodGroup instead of the method hashtable.
2829 * expression.cs: Add MethodGroup abstraction, which gets us one
2830 step closer to the specification in the way we handle method
2833 * cs-parser.jay (primary_expression): qualified_identifier now
2834 tried to match up an identifier to a local variable reference or
2835 to a parameter reference.
2837 current_local_parameters is now a parser global variable that
2838 points to the current parameters for the block, used during name
2841 (property_declaration): Now creates an implicit `value' argument to
2844 2001-05-09 Miguel de Icaza <miguel@ximian.com>
2846 * parameter.cs: Do not use `param' arguments as part of the
2847 signature, per the spec.
2849 2001-05-08 Miguel de Icaza <miguel@ximian.com>
2851 * decl.cs: Base class for classes, structs and interfaces. This
2852 is the "Declaration Space"
2854 * cs-parser.jay: Use CheckDef for checking declaration errors
2855 instead of having one on each function.
2857 * class.cs: Factor out some code for handling error handling in
2858 accordance to the "Declarations" section in the "Basic Concepts"
2859 chapter in the ECMA C# spec.
2861 * interface.cs: Make all interface member classes derive from
2862 InterfaceMemberBase.
2864 2001-05-07 Miguel de Icaza <miguel@ximian.com>
2866 * Many things: all interfaces are parsed and generated in
2867 gen-treedump. Support for member variables, constructors,
2868 destructors, properties, constants is there.
2870 Beginning of the IL backend, but very little done, just there for
2873 2001-04-29 Miguel de Icaza <miguel@ximian.com>
2875 * cs-parser.jay: Fix labeled statement.
2877 * cs-tokenizer.cs (escape): Escape " and ' always.
2878 ref_line, ref_name: keep track of the line/filename as instructed
2879 by #line by the compiler.
2882 2001-04-27 Miguel de Icaza <miguel@ximian.com>
2884 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
2885 to match the values in System.CodeDOM.
2887 Divid renamed to Divide.
2889 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
2891 (Statements.set): remove.
2893 * System.CodeDOM/CodeCatchClause.cs: always have a valid
2896 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
2897 falseStatements always have valid values.
2899 * cs-parser.jay: Use System.CodeDOM now.