1 2001-09-26 Miguel de Icaza <miguel@ximian.com>
3 * assign.cs (Assign): Make it inherit from ExpressionStatement.
5 * expression.cs (ExpressionStatement): New base class used for
6 expressions that can appear in statements, so that we can provide
7 an alternate path to generate expression that do not leave a value
10 (Expression::Emit, and all the derivatives): We no longer return
11 whether a value is left on the stack or not. Every expression
12 after being emitted leaves a single value on the stack.
14 * codegen.cs (EmitContext::EmitStatementExpression): Use the
15 facilties of ExpressionStatement if possible.
17 * cs-parser.jay: Update statement_expression.
19 2001-09-25 Miguel de Icaza <miguel@ximian.com>
21 * driver.cs: Change the wording of message
23 2001-09-25 Ravi Pratap <ravi@ximian.com>
25 * expression.cs (Binary::ResolveOperator): Had forgottten to set
26 the type of the expression to the return type of the method if
27 we have an overloaded operator match ! The regression tests pass again !
28 (Unary::ResolveOperator): Ditto.
30 * expression.cs (Invocation::ConversionExists): Correct the member lookup
31 to find "op_Implicit", not "implicit" ;-)
32 (UserImplicitCast): New class to take care of user-defined implicit conversions.
33 (ConvertImplicit, ForceConversion): Take TypeContainer argument
35 * everywhere : Correct calls to the above accordingly.
37 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
38 (ConvertImplicit): Do user-defined conversion if it exists.
40 2001-09-24 Miguel de Icaza <miguel@ximian.com>
42 * assign.cs: track location.
43 (Resolve): Use implicit conversions on assignment.
45 * literal.cs: Oops. Not good, Emit of short access values should
46 pass (Bytes) or the wrong argument will be selected.
48 * expression.cs (Unary::Emit): Emit code for -expr.
50 (Unary::ResolveOperator): Handle `Substract' for non-constants
51 (substract from zero from the non-constants).
52 Deal with Doubles as well.
54 (Expression::ConvertImplicitRequired): New routine that reports an
55 error if no implicit conversion exists.
57 (Invocation::OverloadResolve): Store the converted implicit
58 expressions if we make them
60 2001-09-24 Ravi Pratap <ravi@ximian.com>
62 * class.cs (ConstructorInitializer): Take a Location argument.
63 (ConstructorBaseInitializer): Same here.
64 (ConstructorThisInitializer): Same here.
66 * cs-parser.jay : Update all calls accordingly.
68 * expression.cs (Unary, Binary, New): Take location argument.
69 Update accordingly everywhere.
71 * cs-parser.jay : Update all calls to the above to take a location
76 2001-09-24 Ravi Pratap <ravi@ximian.com>
78 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
79 (Invocation::BetterConversion): Same here
80 (Invocation::ConversionExists): Ditto.
82 (Invocation::ConversionExists): Implement.
84 2001-09-22 Ravi Pratap <ravi@ximian.com>
86 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
87 Also take an additional TypeContainer argument.
89 * All over : Pass in TypeContainer as argument to OverloadResolve.
91 * typemanager.cs (CSharpName): Update to check for the string type and return
94 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
97 2001-09-21 Ravi Pratap <ravi@ximian.com>
99 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
100 (Invocation::BetterFunction): Implement.
101 (Invocation::BetterConversion): Implement.
102 (Invocation::ConversionExists): Skeleton, no implementation yet.
104 Okay, things work fine !
106 2001-09-21 Miguel de Icaza <miguel@ximian.com>
108 * typemanager.cs: declare and load enum_type, delegate_type and
111 * expression.cs (Expression::Emit): Now emit returns a value that
112 tells whether a value is left on the stack or not. This strategy
113 might be reveted tomorrow with a mechanism that would address
114 multiple assignments.
115 (Expression::report118): Utility routine to report mismatches on
118 (Unary::Report23): Report impossible type/operator combination
121 (Unary::IsIncrementableNumber): Whether the type can be
122 incremented or decremented with add.
123 (Unary::ResolveOperator): Also allow enumerations to be bitwise
125 (Unary::ResolveOperator): Implement ++, !, ~, ++ and --.
127 (Invocation::Emit): Deal with new Emit convetion.
129 * All Expression derivatives: Updated their Emit method to return
130 whether they leave values on the stack or not.
132 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
133 stack for expressions that are statements.
135 2001-09-20 Miguel de Icaza <miguel@ximian.com>
137 * expression.cs (LValue): New interface. Must be implemented by
139 (LocalVariableReference, ParameterReference, FieldExpr): Implement
142 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
143 interface for generating code, simplifies the code.
145 2001-09-20 Ravi Pratap <ravi@ximian.com>
147 * expression.cs (everywhere): Comment out return statements in ::Resolve
148 methods to avoid the warnings.
150 2001-09-20 Miguel de Icaza <miguel@ximian.com>
152 * driver.cs (parse): Report error 2001 if we can not open the
155 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
158 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
161 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
162 otherwise nested blocks end up with the same index.
164 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
166 * expression.cs: Instead of having FIXMEs in the Resolve
167 functions, throw exceptions so it is obvious that we are facing a
170 * cs-parser.jay (invocation_expression): Pass Location information.
172 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
173 Use a basename for those routines because .NET does not like paths
176 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
179 2001-09-19 Miguel de Icaza <miguel@ximian.com>
181 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
182 are loading the correct data types (throws an exception if not).
183 (TypeManager::InitCoreTypes): Use CoreLookupType
185 * expression.cs (Unary::ResolveOperator): return the child
186 expression for expressions which are just +expr.
187 (Unary::ResolveOperator): Return negative literals for -LITERAL
188 expressions (otherwise they are Unary {Literal}).
189 (Invocation::Badness): Take into account `Implicit constant
190 expression conversions'.
192 * literal.cs (LongLiteral): Implement long literal class.
193 (IntLiteral): export the `Value' of the intliteral.
195 2001-09-19 Ravi Pratap <ravi@ximian.com>
197 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
199 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
200 instead of 'Operator'
202 * expression.cs (Binary::ResolveOperator): Update accordingly.
203 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
206 * cs-parser.jay (unary_expression): Update to use the new names.
208 * gen-treedump.cs (GetUnary): Same here.
210 * expression.cs (Unary::Resolve): Implement.
211 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
212 operators are found instead of making noise ;-)
213 (Unary::ResolveOperator): New method to do precisely the same thing which
214 Binary::ResolveOperator does for Binary expressions.
215 (Unary.method, .Arguments): Add.
216 (Unary::OperName): Implement.
217 (Unary::ForceConversion): Copy and Paste !
219 * class.cs (Operator::Define): Fix a small bug for the case when we have
222 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
223 for the inbuilt operators. Only overloading works for now ;-)
225 2001-09-18 Miguel de Icaza <miguel@ximian.com>
227 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
228 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
230 * expression.cs (This::Emit): Implement.
231 (This::Resolve): Implement.
232 (TypeOf:Resolve): Implement.
233 (Expression::ResolveSimpleName): Add an implicit this to instance
235 (MemberAccess::Resolve): Deal with Parameters and Fields.
236 Bind instance variable to Field expressions.
237 (FieldExpr::Instance): New field used to track the expression that
238 represents the object instance.
239 (FieldExpr::Resolve): Track potential errors from MemberLookup not
241 (FieldExpr::Emit): Implement.
243 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
244 the last instruction contains a return opcode to avoid generating
245 the last `ret' instruction (this generates correct code, and it is
246 nice to pass the peverify output).
248 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
249 initializer for static and instance variables.
250 (Constructor::Emit): Allow initializer to be null in the case of
251 static constructors. Only emit initializer for instance
254 (TypeContainer::FindMembers): Return a null array if there are no
257 Also fix the code for the MemberTypes.Method branch, as it was not
258 scanning that for operators (or tried to access null variables before).
260 * assign.cs (Assign::Emit): Handle instance and static fields.
264 * driver.cs: Stop compilation if there are parse errors.
266 * cs-parser.jay (constructor_declaration): Provide default base
267 initializer for non-static constructors.
268 (constructor_declarator): Do not provide a default base
269 initializers if none was specified.
270 Catch the fact that constructors should not have parameters.
272 * class.cs: Do not emit parent class initializers for static
273 constructors, that should be flagged as an error.
275 2001-09-18 Ravi Pratap <ravi@ximian.com>
277 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
278 Move back code into TypeContainer::Populate.
280 2001-09-18 Ravi Pratap <ravi@ximian.com>
282 * class.cs (TypeContainer::AddConstructor): Fix the check to
283 compare against Name, not Basename.
284 (Operator::OpType): Change Plus and Minus to Add and Subtract.
286 * cs-parser.jay : Update accordingly.
288 * class.cs (TypeContainer::FindMembers): For the case where we are searching
289 for methods, don't forget to look into the operators too.
290 (RegisterMethodBuilder): Helper method to take care of this for
291 methods, constructors and operators.
292 (Operator::Define): Completely revamp.
293 (Operator.OperatorMethod, MethodName): New fields.
294 (TypeContainer::Populate): Move the registering of builders into
295 RegisterMethodBuilder.
296 (Operator::Emit): Re-write.
298 * expression.cs (Binary::Emit): Comment out code path to emit method
299 invocation stuff for the case when we have a user defined operator. I am
300 just not able to get it right !
302 2001-09-17 Miguel de Icaza <miguel@ximian.com>
304 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
307 (Expression::MemberLookup): Provide a version that allows to
308 specify the MemberTypes and BindingFlags.
310 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
311 so it was not fetching variable information from outer blocks.
313 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
314 Beforefieldinit as it was buggy.
316 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
319 * class.cs (Constructor::Emit): Only emit if block is not null.
320 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
321 deal with this by semantically definining it as if the user had
324 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
325 constructors as we now "emit" them at a higher level.
327 (TypeContainer::DefineDefaultConstructor): Used to define the
328 default constructors if none was provided.
330 (ConstructorInitializer): Add methods Resolve and Emit.
332 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
334 2001-09-17 Ravi Pratap <ravi@ximian.com>
336 * class.cs (TypeContainer::EmitDefaultConstructor): Register
337 the default constructor builder with our hashtable for methodbuilders
340 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
341 and argument_count is 0 in which case we have a match.
342 (Binary::ResolveOperator): More null checking and miscellaneous coding
345 2001-09-17 Ravi Pratap <ravi@ximian.com>
347 * rootcontext.cs (IsNameSpace): Compare against null.
349 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
351 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
354 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
357 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
358 we have overloaded operators.
359 (Binary::ResolveOperator): Implement the part which does the operator overload
362 * class.cs (Operator::Emit): Implement.
363 (TypeContainer::Emit): Emit the operators we have too.
365 * expression.cs (Binary::Emit): Update to emit the appropriate code for
366 the case when we have a user-defined operator.
368 2001-09-17 Miguel de Icaza <miguel@ximian.com>
370 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
372 2001-09-16 Ravi Pratap <ravi@ximian.com>
374 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
375 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
376 (Constructor::Emit): Implement.
377 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
378 if we have no work to do.
379 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
382 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
383 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
385 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
388 2001-09-15 Ravi Pratap <ravi@ximian.com>
390 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
392 (Tree::RecordNamespace): Method to do what the name says ;-)
393 (Tree::Namespaces): Property to get at the namespaces hashtable.
395 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
398 * rootcontext.cs (IsNamespace): Fixed it :-)
400 2001-09-14 Miguel de Icaza <miguel@ximian.com>
402 * class.cs (TypeContainer::FindMembers): Add support for
404 (MethodCore): New class that encapsulates both the shared aspects
405 of a Constructor and a Method.
406 (Method, Constructor): Factored pieces into MethodCore.
408 * driver.cs: Added --fatal which makes errors throw exceptions.
409 Load System assembly as well as part of the standard library.
411 * report.cs: Allow throwing exceptions on errors for debugging.
413 * modifiers.cs: Do not use `parent', instead use the real type
414 container to evaluate permission settings.
416 * class.cs: Put Ravi's patch back in. He is right, and we will
417 have to cope with the
419 2001-09-14 Ravi Pratap <ravi@ximian.com>
421 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
422 FamORAssem, not FamANDAssem.
424 2001-09-14 Miguel de Icaza <miguel@ximian.com>
426 * driver.cs: Added --parse option that only parses its input files
429 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
430 incorrect. IsTopLevel is not used to tell whether an object is
431 root_types or not (that can be achieved by testing this ==
432 root_types). But to see if this is a top-level *class* (not
433 necessarly our "toplevel" container).
435 2001-09-14 Ravi Pratap <ravi@ximian.com>
437 * enum.cs (Enum::Define): Modify to call the Lookup method on the
438 parent instead of a direct call to GetType.
440 2001-09-14 Ravi Pratap <ravi@ximian.com>
442 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
443 Modifiers.TypeAttr. This should just be a call to that method.
445 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
446 object so that we can determine if we are top-level or not.
448 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
451 * enum.cs (Enum::Define): Ditto.
453 * modifiers.cs (FieldAttr): Re-write.
455 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
456 (TypeContainer::HaveStaticConstructor): New property to provide access
457 to precisely that info.
459 * modifiers.cs (MethodAttr): Re-write.
460 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
462 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
463 of top-level types as claimed.
465 2001-09-13 Miguel de Icaza <miguel@ximian.com>
467 * expression.cs (MemberLookup): Fruitless attempt to lookup
468 constructors. Maybe I need to emit default constructors? That
469 might be it (currently .NET emits this for me automatically).
470 (Invocation::OverloadResolve): Cope with Arguments == null.
471 (Invocation::EmitArguments): new function, shared by the new
473 (Invocation::Emit): Handle static and instance methods. Emit
474 proper call instruction for virtual or non-virtual invocations.
475 (New::Emit): Implement.
476 (New::Resolve): Implement.
477 (MemberAccess:Resolve): Implement.
478 (MethodGroupExpr::InstanceExpression): used conforming to the spec
480 (FieldExpr::Resolve): Set type.
482 * support.cs: Handle empty arguments.
484 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
485 SimpleLookup): Auxiliary routines to help parse a qualifier
488 Update qualifier_identifier rule.
490 * codegen.cs: Removed debugging messages.
492 * class.cs: Make this a global thing, this acts just as a "key" to
493 objects that we might have around.
495 (Populate): Only initialize method_builders_to_methods once.
497 * expression.cs (PropertyExpr): Initialize type from the
500 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
501 Resolve pattern. Attempt to implicitly convert value to boolean.
504 * expression.cs: Set the type for the int32/int32 argument case.
505 (Binary::ResolveOperator): Set the return type to boolean for
506 comparission operators
508 * typemanager.cs: Remove debugging print code.
510 (Invocation::Resolve): resolve type.
512 * class.cs: Allocate a MemberInfo of the correct size, as the code
513 elsewhere depends on the test to reflect the correct contents.
515 (Method::) Keep track of parameters, due to System.Reflection holes
517 (TypeContainer::Populate): Keep track of MethodBuilders to Method
520 (TypeContainer::FindMembers): Use ArrayList and then copy an array
521 of the exact size and return that.
523 (Class::LookupMethodByBuilder): New function that maps
524 MethodBuilders to its methods. Required to locate the information
525 on methods because System.Reflection bit us again.
527 * support.cs: New file, contains an interface ParameterData and
528 two implementations: ReflectionParameters and InternalParameters
529 used to access Parameter information. We will need to grow this
532 * expression.cs (Invocation::GetParameterData): implement a cache
533 and a wrapper around the ParameterData creation for methods.
534 (Invocation::OverloadResolve): Use new code.
536 2001-09-13 Ravi Pratap <ravi@ximian.com>
538 * class.cs (TypeContainer::EmitField): Remove and move into
539 (Field::Define): here and modify accordingly.
540 (Field.FieldBuilder): New member.
541 (TypeContainer::Populate): Update accordingly.
542 (TypeContainer::FindMembers): Implement.
544 2001-09-13 Miguel de Icaza <miguel@ximian.com>
546 * statement.cs: (VariableInfo::VariableType): New field to be
547 initialized with the full type once it is resolved.
549 2001-09-12 Miguel de Icaza <miguel@ximian.com>
551 * parameter.cs (GetParameterInfo): Use a type cache to compute
552 things only once, and to reuse this information
554 * expression.cs (LocalVariableReference::Emit): Implement.
555 (OpcodeCast::Emit): fix.
557 (ParameterReference::Resolve): Implement.
558 (ParameterReference::Emit): Implement.
560 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
561 that are expressions need to stay as Expressions.
563 * typemanager.cs (CSharpName): Returns the C# name of a type if
566 * expression.cs (Expression::ConvertImplicit): New function that
567 implements implicit type conversions.
569 (Expression::ImplicitReferenceConversion): Implements implicit
570 reference conversions.
572 (EmptyCast): New type for transparent casts.
574 (OpcodeCast): New type for casts of types that are performed with
575 a sequence of bytecodes.
577 (BoxedCast): New type used for casting value types into reference
578 types. Emits a box opcode.
580 (Binary::DoNumericPromotions): Implements numeric promotions of
581 and computation of the Binary::Type.
583 (Binary::EmitBranchable): Optimization.
585 (Binary::Emit): Implement code emission for expressions.
587 * typemanager.cs (TypeManager): Added two new core types: sbyte
590 2001-09-12 Ravi Pratap <ravi@ximian.com>
592 * class.cs (TypeContainer::FindMembers): Method which does exactly
593 what Type.FindMembers does, only we don't have to use reflection. No
596 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
597 typecontainer objects as we need to get at them.
598 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
600 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
601 typecontainer object.
603 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
604 of just a Report object.
606 2001-09-11 Ravi Pratap <ravi@ximian.com>
608 * class.cs (Event::Define): Go back to using the prefixes "add_" and
610 (TypeContainer::Populate): Now define the delegates of the type too.
611 (TypeContainer.Delegates): Property to access the list of delegates defined
614 * delegates.cs (Delegate::Define): Implement partially.
616 * modifiers.cs (TypeAttr): Handle more flags.
618 2001-09-11 Ravi Pratap <ravi@ximian.com>
620 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
622 (Operator::Define): Re-write logic to get types by using the LookupType method
623 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
624 (Indexer::Define): Ditto.
625 (Event::Define): Ditto.
626 (Property::Define): Ditto.
628 2001-09-10 Ravi Pratap <ravi@ximian.com>
630 * class.cs (TypeContainer::Populate): Now define operators too.
631 (TypeContainer.Operators): New property to access the list of operators
633 (Operator.OperatorMethodBuilder): New member to hold the method builder
634 for the operator we are defining.
635 (Operator::Define): Implement.
637 2001-09-10 Ravi Pratap <ravi@ximian.com>
639 * class.cs (Event::Define): Make the prefixes of the accessor methods
642 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
643 of the location being passed in too. Ideally, this should go later since all
644 error reporting should be done through the Report object.
646 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
647 (Populate): Iterate thru the indexers we have and define them too.
648 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
649 for the get and set accessors.
650 (Indexer::Define): Implement.
652 2001-09-09 Miguel de Icaza <miguel@ximian.com>
654 * expression.cs (Binary::Resolve): Beginning of it. I scratched
655 my previous implementation, did not work.
657 * typemanager.cs: Add a couple of missing types (the longs).
659 * literal.cs: Use TypeManager.bool_type instead of getting it.
661 * expression.cs (EventExpr): New kind of expressions.
662 (Expressio::ExprClassFromMemberInfo): finish
664 2001-09-08 Miguel de Icaza <miguel@ximian.com>
666 * assign.cs: Emit stores to static fields differently.
668 2001-09-08 Ravi Pratap <ravi@ximian.com>
670 * Merge in changes and adjust code to tackle conflicts. Backed out my
671 code in Assign::Resolve ;-)
673 2001-09-08 Ravi Pratap <ravi@ximian.com>
675 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
676 instead Report.Error and also pass in the location.
677 (CSharpParser::Lexer): New readonly property to return the reference
678 to the Tokenizer object.
679 (declare_local_variables): Use Report.Error with location instead of plain
683 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
684 (Operator.CheckBinaryOperator): Ditto.
686 * cs-parser.jay (operator_declarator): Update accordingly.
688 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
689 (CheckBinaryOperator): Same here.
691 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
692 on the name without any prefixes of namespace names etc. This is because we
693 already might have something already fully qualified like
694 'System.Console.WriteLine'
696 * assign.cs (Resolve): Begin implementation. Stuck ;-)
698 2001-09-07 Ravi Pratap <ravi@ximian.com>
700 * cs-tokenizer.cs (location): Return a string which also contains
703 * expression.cs (ElementAccess): New class for expressions of the
704 type 'element access.'
705 (BaseAccess): New class for expressions of the type 'base access.'
706 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
709 * cs-parser.jay (element_access): Implement action.
710 (base_access): Implement actions.
711 (checked_expression, unchecked_expression): Implement.
713 * cs-parser.jay (local_variable_type): Correct and implement.
714 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
716 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
718 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
719 name and the specifiers.
721 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
723 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
724 making them all public ;-)
726 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
729 2001-09-07 Miguel de Icaza <miguel@ximian.com>
731 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
733 (FieldExpr, PropertyExprs): New resolved expressions.
734 (SimpleName::MemberStaticCheck): Perform static checks for access
735 to non-static fields on static methods. Maybe this should be
736 generalized for MemberAccesses.
737 (SimpleName::ResolveSimpleName): More work on simple name
740 * cs-parser.jay (primary_expression/qualified_identifier): track
743 * codegen.cs (CodeGen::Save): Catch save exception, report error.
744 (EmitContext::EmitBoolExpression): Chain to expression generation
745 instead of temporary hack.
746 (::EmitStatementExpression): Put generic expression code generation.
748 * assign.cs (Assign::Emit): Implement variable assignments to
749 local variables, parameters and fields.
751 2001-09-06 Miguel de Icaza <miguel@ximian.com>
753 * statement.cs (Block::GetVariableInfo): New method, returns the
754 VariableInfo for a variable name in a block.
755 (Block::GetVariableType): Implement in terms of GetVariableInfo
757 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
758 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
760 2001-09-06 Ravi Pratap <ravi@ximian.com>
762 * cs-parser.jay (operator_declaration): Continue on my quest : update
763 to take attributes argument.
764 (event_declaration): Ditto.
765 (enum_declaration): Ditto.
766 (indexer_declaration): Ditto.
768 * class.cs (Operator::Operator): Update constructor accordingly.
769 (Event::Event): Ditto.
771 * delegate.cs (Delegate::Delegate): Same here.
773 * enum.cs (Enum::Enum): Same here.
775 2001-09-05 Ravi Pratap <ravi@ximian.com>
777 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
779 * ../tests/cs0658.cs : New file to demonstrate error 0658.
781 * attribute.cs (Attributes): New class to encapsulate all attributes which were
782 being passed around as an arraylist.
783 (Attributes::AddAttribute): Method to add attribute sections.
785 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
786 (struct_declaration): Update accordingly.
787 (constant_declaration): Update.
788 (field_declaration): Update.
789 (method_header): Update.
790 (fixed_parameter): Update.
791 (parameter_array): Ditto.
792 (property_declaration): Ditto.
793 (destructor_declaration): Ditto.
795 * class.cs (Struct::Struct): Update constructors accordingly.
796 (Class::Class): Ditto.
797 (Field::Field): Ditto.
798 (Method::Method): Ditto.
799 (Property::Property): Ditto.
800 (TypeContainer::OptAttribute): update property's return type.
802 * interface.cs (Interface.opt_attributes): New member.
803 (Interface::Interface): Update to take the extra Attributes argument.
805 * parameter.cs (Parameter::Parameter): Ditto.
807 * constant.cs (Constant::Constant): Ditto.
809 * interface.cs (InterfaceMemberBase): New OptAttributes field.
810 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
811 the attributes as a parameter.
812 (InterfaceProperty): Update constructor call.
813 (InterfaceEvent): Ditto.
814 (InterfaceMethod): Ditto.
815 (InterfaceIndexer): Ditto.
817 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
818 pass the attributes too.
819 (interface_event_declaration): Ditto.
820 (interface_property_declaration): Ditto.
821 (interface_method_declaration): Ditto.
822 (interface_declaration): Ditto.
824 2001-09-05 Miguel de Icaza <miguel@ximian.com>
826 * class.cs (Method::Define): Track the "static Main" definition to
827 create an entry point.
829 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
830 EntryPoint if we find it.
832 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
833 (EmitContext::ig): Make this variable public.
835 * driver.cs: Make the default output file be the first file name
836 with the .exe extension.
838 Detect empty compilations
840 Handle various kinds of output targets. Handle --target and
841 rename -t to --dumper.
843 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
844 methods inherited from Expression return now an Expression. This
845 will is used during the tree rewriting as we resolve them during
848 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
849 the spec. Missing entirely is the information about
850 accessability of elements of it.
852 (Expression::ExprClassFromMemberInfo): New constructor for
853 Expressions that creates a fully initialized Expression based on
854 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
857 (Invocation::Resolve): Begin implementing resolution of invocations.
859 * literal.cs (StringLiteral): Implement Emit.
861 2001-09-05 Ravi Pratap <ravi@ximian.com>
863 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
866 2001-09-04 Ravi Pratap <ravi@ximian.com>
868 * cs-parser.jay (attribute_arguments): Implement actions.
869 (attribute): Fix bug in production. Implement action.
870 (attribute_list): Implement.
871 (attribute_target): Implement.
872 (attribute_target_specifier, opt_target_specifier): Implement
873 (CheckAttributeTarget): New method to check if the attribute target
875 (attribute_section): Implement.
876 (opt_attributes): Implement.
878 * attribute.cs : New file to handle attributes.
879 (Attribute): Class to hold attribute info.
881 * cs-parser.jay (opt_attribute_target_specifier): Remove production
882 (attribute_section): Modify production to use 2 different rules to
883 achieve the same thing. 1 s/r conflict down !
884 Clean out commented, useless, non-reducing dimension_separator rules.
886 * class.cs (TypeContainer.attributes): New member to hold list
887 of attributes for a type.
888 (Struct::Struct): Modify to take one more argument, the attribute list.
889 (Class::Class): Ditto.
890 (Field::Field): Ditto.
891 (Method::Method): Ditto.
892 (Property::Property): Ditto.
894 * cs-parser.jay (struct_declaration): Update constructor call to
895 pass in the attributes too.
896 (class_declaration): Ditto.
897 (constant_declaration): Ditto.
898 (field_declaration): Ditto.
899 (method_header): Ditto.
900 (fixed_parameter): Ditto.
901 (parameter_array): Ditto.
902 (property_declaration): Ditto.
904 * constant.cs (Constant::Constant): Update constructor similarly.
905 Use System.Collections.
907 * parameter.cs (Parameter::Parameter): Update as above.
909 2001-09-02 Ravi Pratap <ravi@ximian.com>
911 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
912 (TypeContainer.delegates): New member to hold list of delegates.
914 * cs-parser.jay (delegate_declaration): Implement the action correctly
915 this time as I seem to be on crack ;-)
917 2001-09-02 Miguel de Icaza <miguel@ximian.com>
919 * rootcontext.cs (RootContext::IsNamespace): new function, used to
920 tell whether an identifier represents a namespace.
922 * expression.cs (NamespaceExpr): A namespace expression, used only
923 temporarly during expression resolution.
924 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
925 utility functions to resolve names on expressions.
927 2001-09-01 Miguel de Icaza <miguel@ximian.com>
929 * codegen.cs: Add hook for StatementExpressions.
931 * class.cs: Fix inverted test for static flag in methods.
933 2001-09-02 Ravi Pratap <ravi@ximian.com>
935 * class.cs (Operator::CheckUnaryOperator): Correct error number used
936 to make it coincide with MS' number.
937 (Operator::CheckBinaryOperator): Ditto.
939 * ../errors/errors.txt : Remove error numbers added earlier.
941 * ../errors/cs1019.cs : Test case for error # 1019
943 * ../errros/cs1020.cs : Test case for error # 1020
945 * cs-parser.jay : Clean out commented cruft.
946 (dimension_separators, dimension_separator): Comment out. Ostensibly not
947 used anywhere - non-reducing rule.
948 (namespace_declarations): Non-reducing rule - comment out.
950 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
951 with TypeContainer::AddEnum.
953 * delegate.cs : New file for delegate handling classes.
954 (Delegate): Class for declaring delegates.
958 * cs-parser.jay (delegate_declaration): Implement.
960 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
962 * class.cs (Event::Define): Implement.
963 (Event.EventBuilder): New member.
965 * class.cs (TypeContainer::Populate): Update to define all enums and events
967 (Events): New property for the events arraylist we hold. Shouldn't we move to using
968 readonly fields for all these cases ?
970 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
972 * class.cs (Property): Revamp to use the convention of making fields readonly.
973 Accordingly modify code elsewhere.
975 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
976 the Define method of the Property class.
978 * class.cs : Clean up applied patch and update references to variables etc. Fix
980 (TypeContainer::Populate): Update to define all the properties we have. Also
981 define all enumerations.
983 * enum.cs (Define): Implement.
985 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
987 * cs-parser.jay (overloadable_operator): The semantic value is an
988 enum of the Operator class.
989 (operator_declarator): Implement actions.
990 (operator_declaration): Implement.
992 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
993 validity of definitions.
994 (Operator::CheckBinaryOperator): Static method to check for binary operators
995 (TypeContainer::AddOperator): New method to add an operator to a type.
997 * cs-parser.jay (indexer_declaration): Added line to actually call the
998 AddIndexer method so it gets added ;-)
1000 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
1001 already taken care of by the MS compiler ?
1003 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
1005 * class.cs (Operator): New class for operator declarations.
1006 (Operator::OpType): Enum for the various operators.
1008 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
1010 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
1011 ostensibly handle this in semantic analysis.
1013 * cs-parser.jay (general_catch_clause): Comment out
1014 (specific_catch_clauses, specific_catch_clause): Ditto.
1015 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
1016 (catch_args, opt_catch_args): New productions.
1017 (catch_clause): Rewrite to use the new productions above
1018 (catch_clauses): Modify accordingly.
1019 (opt_catch_clauses): New production to use in try_statement
1020 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
1021 and re-write the code in the actions to extract the specific and
1022 general catch clauses by being a little smart ;-)
1024 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
1025 Hooray, try and catch statements parse fine !
1027 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1029 * statement.cs (Block::GetVariableType): Fix logic to extract the type
1030 string from the hashtable of variables.
1032 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
1033 I end up making that mistake ;-)
1034 (catch_clauses): Fixed gross error which made Key and Value of the
1035 DictionaryEntry the same : $1 !!
1037 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1039 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
1041 * cs-parser.jay (event_declaration): Correct to remove the semicolon
1042 when the add and remove accessors are specified.
1044 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1046 * cs-parser.jay (IndexerDeclaration): New helper class to hold
1047 information about indexer_declarator.
1048 (indexer_declarator): Implement actions.
1049 (parsing_indexer): New local boolean used to keep track of whether
1050 we are parsing indexers or properties. This is necessary because
1051 implicit_parameters come into picture even for the get accessor in the
1053 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
1055 * class.cs (Indexer): New class for indexer declarations.
1056 (TypeContainer::AddIndexer): New method to add an indexer to a type.
1057 (TypeContainer::indexers): New member to hold list of indexers for the
1060 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
1062 * cs-parser.jay (add_accessor_declaration): Implement action.
1063 (remove_accessor_declaration): Implement action.
1064 (event_accessors_declaration): Implement
1065 (variable_declarators): swap statements for first rule - trivial.
1067 * class.cs (Event): New class to hold information about event
1069 (TypeContainer::AddEvent): New method to add an event to a type
1070 (TypeContainer::events): New member to hold list of events.
1072 * cs-parser.jay (event_declaration): Implement actions.
1074 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
1076 * cs-parser.jay (dim_separators): Implement. Make it a string
1077 concatenating all the commas together, just as they appear.
1078 (opt_dim_separators): Modify accordingly
1079 (rank_specifiers): Update accordingly. Basically do the same
1080 thing - instead, collect the brackets here.
1081 (opt_rank_sepcifiers): Modify accordingly.
1082 (array_type): Modify to actually return the complete type string
1083 instead of ignoring the rank_specifiers.
1084 (expression_list): Implement to collect the expressions
1085 (variable_initializer): Implement. We make it a list of expressions
1086 essentially so that we can handle the array_initializer case neatly too.
1087 (variable_initializer_list): Implement.
1088 (array_initializer): Make it a list of variable_initializers
1089 (opt_array_initializer): Modify accordingly.
1091 * expression.cs (New::NType): Add enumeration to help us
1092 keep track of whether we have an object/delegate creation
1093 or an array creation.
1094 (New:NewType, New::Rank, New::Indices, New::Initializers): New
1095 members to hold data about array creation.
1096 (New:New): Modify to update NewType
1097 (New:New): New Overloaded contructor for the array creation
1100 * cs-parser.jay (array_creation_expression): Implement to call
1101 the overloaded New constructor.
1103 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
1105 * class.cs (TypeContainer::Constructors): Return member
1106 constructors instead of returning null.
1108 2001-08-26 Miguel de Icaza <miguel@ximian.com>
1110 * typemanager.cs (InitCoreTypes): Initialize the various core
1111 types after we have populated the type manager with the user
1112 defined types (this distinction will be important later while
1113 compiling corlib.dll)
1115 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
1116 on Expression Classification. Now all expressions have a method
1117 `Resolve' and a method `Emit'.
1119 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
1120 generation from working. Also add some temporary debugging
1123 2001-08-24 Miguel de Icaza <miguel@ximian.com>
1125 * codegen.cs: Lots of code generation pieces. This is only the
1126 beginning, will continue tomorrow with more touches of polish. We
1127 handle the fundamentals of if, while, do, for, return. Others are
1128 trickier and I need to start working on invocations soon.
1130 * gen-treedump.cs: Bug fix, use s.Increment here instead of
1133 * codegen.cs (EmitContext): New struct, used during code
1134 emission to keep a context. Most of the code generation will be
1137 * cs-parser.jay: Add embedded blocks to the list of statements of
1138 this block. So code generation proceeds in a top down fashion.
1140 2001-08-23 Miguel de Icaza <miguel@ximian.com>
1142 * statement.cs: Add support for multiple child blocks.
1144 2001-08-22 Miguel de Icaza <miguel@ximian.com>
1146 * codegen.cs (EmitCode): New function, will emit the code for a
1147 Block of code given a TypeContainer and its ILGenerator.
1149 * statement.cs (Block): Standard public readonly optimization.
1150 (Block::Block constructors): Link children.
1151 (Block::Child): Child Linker.
1152 (Block::EmitVariables): Emits IL variable declarations.
1154 * class.cs: Drop support for MethodGroups here, delay until
1156 (Method::): Applied the same simplification that I did before, and
1157 move from Properties to public readonly fields.
1158 (Method::ParameterTypes): Returns the parameter types for the
1159 function, and implements a cache that will be useful later when I
1160 do error checking and the semantic analysis on the methods is
1162 (Constructor::GetCallingConvention): Renamed from CallingConvetion
1163 and made a method, optional argument tells whether this is a class
1164 or a structure to apply the `has-this' bit.
1165 (Method::GetCallingConvention): Implement, returns the calling
1167 (Method::Define): Defines the type, a second pass is performed
1168 later to populate the methods.
1170 (Constructor::ParameterTypes): implement a cache similar to the
1171 one on Method::ParameterTypes, useful later when we do semantic
1174 (TypeContainer::EmitMethod): New method. Emits methods.
1176 * expression.cs: Removed MethodGroup class from here.
1178 * parameter.cs (Parameters::GetCallingConvention): new method.
1180 2001-08-21 Miguel de Icaza <miguel@ximian.com>
1182 * class.cs (TypeContainer::Populate): Drop RootContext from the
1185 (Constructor::CallingConvention): Returns the calling convention.
1186 (Constructor::ParameterTypes): Returns the constructor parameter
1189 (TypeContainer::AddConstructor): Keep track of default constructor
1190 and the default static constructor.
1192 (Constructor::) Another class that starts using `public readonly'
1193 instead of properties.
1195 (Constructor::IsDefault): Whether this is a default constructor.
1197 (Field::) use readonly public fields instead of properties also.
1199 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
1200 track of static constructors; If none is used, turn on
1201 BeforeFieldInit in the TypeAttributes.
1203 * cs-parser.jay (opt_argument_list): now the return can be null
1204 for the cases where there are no arguments.
1206 (constructor_declarator): If there is no implicit `base' or
1207 `this', then invoke the default parent constructor.
1209 * modifiers.cs (MethodAttr): New static function maps a set of
1210 modifiers flags into a MethodAttributes enum
1211 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
1212 MethodAttr, TypeAttr to represent the various mappings where the
1214 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
1216 2001-08-19 Miguel de Icaza <miguel@ximian.com>
1218 * parameter.cs (GetParameterInfo): Fix bug where there would be no
1221 * interface.cs (PopulateIndexer): Implemented the code generator
1222 for interface indexers.
1224 2001-08-17 Miguel de Icaza <miguel@ximian.com>
1226 * interface.cs (InterfaceMemberBase): Now we track the new status
1229 (PopulateProperty): Implement property population. Woohoo! Got
1230 Methods and Properties going today.
1232 Removed all the properties for interfaces, and replaced them with
1233 `public readonly' fields.
1235 2001-08-16 Miguel de Icaza <miguel@ximian.com>
1237 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
1238 initialize their hashtables/arraylists only when they are needed
1239 instead of doing this always.
1241 * parameter.cs: Handle refs and out parameters.
1243 * cs-parser.jay: Use an ArrayList to construct the arguments
1244 instead of the ParameterCollection, and then cast that to a
1247 * parameter.cs: Drop the use of ParameterCollection and use
1248 instead arrays of Parameters.
1250 (GetParameterInfo): Use the Type, not the Name when resolving
1253 2001-08-13 Miguel de Icaza <miguel@ximian.com>
1255 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
1256 and instead use public readonly fields.
1258 * class.cs: Put back walking code for type containers.
1260 2001-08-11 Miguel de Icaza <miguel@ximian.com>
1262 * class.cs (MakeConstant): Code to define constants.
1264 * rootcontext.cs (LookupType): New function. Used to locate types
1267 2001-08-08 Miguel de Icaza <miguel@ximian.com>
1269 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
1270 this System.Reflection code is. Kudos to Microsoft
1272 * typemanager.cs: Implement a type cache and avoid loading all
1273 types at boot time. Wrap in LookupType the internals. This made
1274 the compiler so much faster. Wow. I rule!
1276 * driver.cs: Make sure we always load mscorlib first (for
1277 debugging purposes, nothing really important).
1279 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
1280 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
1282 * rootcontext.cs: Lookup types on their namespace; Lookup types
1283 on namespaces that have been imported using the `using' keyword.
1285 * class.cs (TypeContainer::TypeAttr): Virtualize.
1286 (Class::TypeAttr): Return attributes suitable for this bad boy.
1287 (Struct::TypeAttr): ditto.
1288 Handle nested classes.
1289 (TypeContainer::) Remove all the type visiting code, it is now
1290 replaced with the rootcontext.cs code
1292 * rootcontext.cs (GetClassBases): Added support for structs.
1294 2001-08-06 Miguel de Icaza <miguel@ximian.com>
1296 * interface.cs, statement.cs, class.cs, parameter.cs,
1297 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
1298 Drop use of TypeRefs, and use strings instead.
1300 2001-08-04 Miguel de Icaza <miguel@ximian.com>
1304 * class.cs (Struct::Struct): set the SEALED flags after
1305 checking the modifiers.
1306 (TypeContainer::TypeAttr): new property, returns the
1307 TypeAttributes for a class.
1309 * cs-parser.jay (type_list): Oops, list production was creating a
1310 new list of base types.
1312 * rootcontext.cs (StdLib): New property.
1313 (GetInterfaceTypeByName): returns an interface by type name, and
1314 encapsulates error handling here.
1315 (GetInterfaces): simplified.
1316 (ResolveTree): Encapsulated all the tree resolution here.
1317 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
1320 * driver.cs: Add support for --nostdlib, to avoid loading the
1322 (Main): Do not put tree resolution here.
1324 * rootcontext.cs: Beginning of the class resolution.
1326 2001-08-03 Miguel de Icaza <miguel@ximian.com>
1328 * rootcontext.cs: Provide better error reporting.
1330 * cs-parser.jay (interface_base): set our $$ to be interfaces.
1332 * rootcontext.cs (CreateInterface): Handle the case where there
1333 are no parent interfaces.
1335 (CloseTypes): Routine to flush types at the end.
1336 (CreateInterface): Track types.
1337 (GetInterfaces): Returns an array of Types from the list of
1340 * typemanager.c (AddUserType): Mechanism to track user types (puts
1341 the type on the global type hash, and allows us to close it at the
1344 2001-08-02 Miguel de Icaza <miguel@ximian.com>
1346 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
1347 RecordInterface instead.
1349 * cs-parser.jay: Updated to reflect changes above.
1351 * decl.cs (Definition): Keep track of the TypeBuilder type that
1352 represents this type here. Not sure we will use it in the long
1353 run, but wont hurt for now.
1355 * driver.cs: Smaller changes to accomodate the new code.
1357 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
1360 * rootcontext.cs (CreateInterface): New method, used to create
1361 the System.TypeBuilder type for interfaces.
1362 (ResolveInterfaces): new entry point to resolve the interface
1364 (CodeGen): Property, used to keep track of the code generator.
1366 2001-07-26 Miguel de Icaza <miguel@ximian.com>
1368 * cs-parser.jay: Add a second production for delegate_declaration
1371 (enum_body): Put an opt_comma here instead of putting it on
1372 enum_body or enum_member_declarations so we can handle trailing
1373 commas on enumeration members. Gets rid of a shift/reduce.
1375 (type_list): Need a COMMA in the middle.
1377 (indexer_declaration): Tell tokenizer to recognize get/set
1379 * Remove old targets.
1381 * Re-add the parser target.
1383 2001-07-13 Simon Cozens <simon@simon-cozens.org>
1385 * cs-parser.jay: Add precendence rules for a number of operators
1386 ot reduce the number of shift/reduce conflicts in the grammar.
1388 2001-07-17 Miguel de Icaza <miguel@ximian.com>
1390 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
1393 Get rid of old crufty code.
1395 * rootcontext.cs: Use this to keep track of the parsed
1396 representation and the defined types available to the program.
1398 * gen-treedump.cs: adjust for new convention.
1400 * type.cs: Split out the type manager, and the assembly builder
1403 * typemanager.cs: the type manager will live here now.
1405 * cil-codegen.cs: And the code generator here.
1407 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
1409 * makefile: Fixed up for easy making.
1411 2001-07-13 Simon Cozens <simon@simon-cozens.org>
1413 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
1416 (unary_expression): Expand pre_increment_expression and
1417 post_decrement_expression to reduce a shift/reduce.
1419 2001-07-11 Simon Cozens
1421 * cs-tokenizer.cs: Hex numbers should begin with a 0.
1423 Improve allow_keyword_as_indent name.
1425 2001-06-19 Miguel de Icaza <miguel@ximian.com>
1427 * Adjustments for Beta2.
1429 2001-06-13 Miguel de Icaza <miguel@ximian.com>
1431 * decl.cs: Added `Define' abstract method.
1432 (InTransit): new property, used to catch recursive definitions.
1434 * interface.cs: Implement `Define'.
1436 * modifiers.cs: Map Modifiers.constants to
1437 System.Reflection.TypeAttribute flags.
1439 * class.cs: Keep track of types and user-defined types.
1440 (BuilderInit): New method for creating an assembly
1441 (ResolveType): New function to launch the resolution process, only
1442 used by interfaces for now.
1444 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
1445 that are inserted into the name space.
1447 2001-06-08 Miguel de Icaza <miguel@ximian.com>
1449 * ARGH. I have screwed up my tree so many times due to the use of
1450 rsync rather than using CVS. Going to fix this at once.
1452 * driver.cs: Objetify driver. Load assemblies, use assemblies to
1455 2001-06-07 Miguel de Icaza <miguel@ximian.com>
1457 * Experiment successful: Use System.Type rather that our own
1460 2001-05-25 Miguel de Icaza <miguel@ximian.com>
1462 * cs-parser.jay: Removed nsAliases from here.
1464 Use new namespaces, handle `using XXX;'
1466 * namespace.cs: Reimplemented namespace handling, use a recursive
1467 definition of the class. Now we can keep track of using clauses
1468 and catch invalid using clauses.
1470 2001-05-24 Miguel de Icaza <miguel@ximian.com>
1472 * gen-treedump.cs: Adapted for all the renaming.
1474 * expression.cs (Expression): this class now has a Type property
1475 which returns an expression Type.
1477 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
1478 `Type', as this has a different meaning now in the base
1480 2001-05-22 Miguel de Icaza <miguel@ximian.com>
1482 * interface.cs, class.cs: Removed from all the sources the
1483 references to signature computation, as we can not do method
1484 signature computation during the parsing time, as we are not
1485 trying to solve at that point distinguishing:
1489 void a (NS.Blah x) {}
1492 Which depending on the context might be valid or not, as we do not
1493 know if Blah is the same thing as NS.Blah at that point.
1495 * Redid everything so the code uses TypeRefs now instead of
1496 Types. TypeRefs are just temporary type placeholders, that need
1497 to be resolved. They initially have a pointer to a string and the
1498 current scope in which they are used. This is used later by the
1499 compiler to resolve the reference to an actual Type.
1501 * DeclSpace is no longer a CIR.Type, and neither are
1502 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
1503 are all DeclSpaces, but no Types.
1505 * type.cs (TypeRefManager): This implements the TypeRef manager,
1506 which keeps track of all the types that need to be resolved after
1507 the parsing has finished.
1509 2001-05-13 Miguel de Icaza <miguel@ximian.com>
1511 * ARGH. We are going to have to store `foreach' as a class rather
1512 than resolving it, as we need to verify error 1579 after name
1513 resolution. *OR* we could keep a flag that says `This request to
1514 IEnumerator comes from a foreach statement' which we can then use
1515 to generate the error.
1517 2001-05-10 Miguel de Icaza <miguel@ximian.com>
1519 * class.cs (TypeContainer.AddMethod): we now add methods to the
1520 MethodGroup instead of the method hashtable.
1522 * expression.cs: Add MethodGroup abstraction, which gets us one
1523 step closer to the specification in the way we handle method
1526 * cs-parser.jay (primary_expression): qualified_identifier now
1527 tried to match up an identifier to a local variable reference or
1528 to a parameter reference.
1530 current_local_parameters is now a parser global variable that
1531 points to the current parameters for the block, used during name
1534 (property_declaration): Now creates an implicit `value' argument to
1537 2001-05-09 Miguel de Icaza <miguel@ximian.com>
1539 * parameter.cs: Do not use `param' arguments as part of the
1540 signature, per the spec.
1542 2001-05-08 Miguel de Icaza <miguel@ximian.com>
1544 * decl.cs: Base class for classes, structs and interfaces. This
1545 is the "Declaration Space"
1547 * cs-parser.jay: Use CheckDef for checking declaration errors
1548 instead of having one on each function.
1550 * class.cs: Factor out some code for handling error handling in
1551 accordance to the "Declarations" section in the "Basic Concepts"
1552 chapter in the ECMA C# spec.
1554 * interface.cs: Make all interface member classes derive from
1555 InterfaceMemberBase.
1557 2001-05-07 Miguel de Icaza <miguel@ximian.com>
1559 * Many things: all interfaces are parsed and generated in
1560 gen-treedump. Support for member variables, constructors,
1561 destructors, properties, constants is there.
1563 Beginning of the IL backend, but very little done, just there for
1566 2001-04-29 Miguel de Icaza <miguel@ximian.com>
1568 * cs-parser.jay: Fix labeled statement.
1570 * cs-tokenizer.cs (escape): Escape " and ' always.
1571 ref_line, ref_name: keep track of the line/filename as instructed
1572 by #line by the compiler.
1575 2001-04-27 Miguel de Icaza <miguel@ximian.com>
1577 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
1578 to match the values in System.CodeDOM.
1580 Divid renamed to Divide.
1582 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
1584 (Statements.set): remove.
1586 * System.CodeDOM/CodeCatchClause.cs: always have a valid
1589 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
1590 falseStatements always have valid values.
1592 * cs-parser.jay: Use System.CodeDOM now.