1 2001-09-26 Miguel de Icaza <miguel@ximian.com>
3 * cs-parser.jay: Update operator constants.
5 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
6 (Parameters::GetSignature): Hook up VerifyArgs here.
7 (Parameters::VerifyArgs): Verifies that no two arguments have the
10 * class.cs (Operator): Update the operator names to reflect the
11 ones that the spec expects (as we are just stringizing the
14 * expression.cs (Unary::ResolveOperator): Fix bug: Use
15 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
16 previous usage did only work for our methods.
17 (Expression::ConvertImplicit): Handle decimal implicit numeric
19 (Expression::InternalTypeConstructor): Used to invoke constructors
20 on internal types for default promotions.
22 (Unary::Emit): Implement special handling for the pre/post
23 increment/decrement for overloaded operators, as they need to have
24 the same semantics as the other operators.
26 (Binary::ResolveOperator): ditto.
27 (Invocation::ConversionExists): ditto.
28 (UserImplicitCast::Resolve): ditto.
30 2001-09-26 Ravi Pratap <ravi@ximian.com>
32 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
33 operator, return after emitting body. Regression tests pass again !
35 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
36 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
37 (Invocation::OverloadResolve): Ditto.
38 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
40 * everywhere : update calls to the above methods accordingly.
42 2001-09-26 Miguel de Icaza <miguel@ximian.com>
44 * assign.cs (Assign): Make it inherit from ExpressionStatement.
46 * expression.cs (ExpressionStatement): New base class used for
47 expressions that can appear in statements, so that we can provide
48 an alternate path to generate expression that do not leave a value
51 (Expression::Emit, and all the derivatives): We no longer return
52 whether a value is left on the stack or not. Every expression
53 after being emitted leaves a single value on the stack.
55 * codegen.cs (EmitContext::EmitStatementExpression): Use the
56 facilties of ExpressionStatement if possible.
58 * cs-parser.jay: Update statement_expression.
60 2001-09-25 Miguel de Icaza <miguel@ximian.com>
62 * driver.cs: Change the wording of message
64 2001-09-25 Ravi Pratap <ravi@ximian.com>
66 * expression.cs (Binary::ResolveOperator): Had forgottten to set
67 the type of the expression to the return type of the method if
68 we have an overloaded operator match ! The regression tests pass again !
69 (Unary::ResolveOperator): Ditto.
71 * expression.cs (Invocation::ConversionExists): Correct the member lookup
72 to find "op_Implicit", not "implicit" ;-)
73 (UserImplicitCast): New class to take care of user-defined implicit conversions.
74 (ConvertImplicit, ForceConversion): Take TypeContainer argument
76 * everywhere : Correct calls to the above accordingly.
78 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
79 (ConvertImplicit): Do user-defined conversion if it exists.
81 2001-09-24 Miguel de Icaza <miguel@ximian.com>
83 * assign.cs: track location.
84 (Resolve): Use implicit conversions on assignment.
86 * literal.cs: Oops. Not good, Emit of short access values should
87 pass (Bytes) or the wrong argument will be selected.
89 * expression.cs (Unary::Emit): Emit code for -expr.
91 (Unary::ResolveOperator): Handle `Substract' for non-constants
92 (substract from zero from the non-constants).
93 Deal with Doubles as well.
95 (Expression::ConvertImplicitRequired): New routine that reports an
96 error if no implicit conversion exists.
98 (Invocation::OverloadResolve): Store the converted implicit
99 expressions if we make them
101 2001-09-24 Ravi Pratap <ravi@ximian.com>
103 * class.cs (ConstructorInitializer): Take a Location argument.
104 (ConstructorBaseInitializer): Same here.
105 (ConstructorThisInitializer): Same here.
107 * cs-parser.jay : Update all calls accordingly.
109 * expression.cs (Unary, Binary, New): Take location argument.
110 Update accordingly everywhere.
112 * cs-parser.jay : Update all calls to the above to take a location
117 2001-09-24 Ravi Pratap <ravi@ximian.com>
119 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
120 (Invocation::BetterConversion): Same here
121 (Invocation::ConversionExists): Ditto.
123 (Invocation::ConversionExists): Implement.
125 2001-09-22 Ravi Pratap <ravi@ximian.com>
127 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
128 Also take an additional TypeContainer argument.
130 * All over : Pass in TypeContainer as argument to OverloadResolve.
132 * typemanager.cs (CSharpName): Update to check for the string type and return
135 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
138 2001-09-21 Ravi Pratap <ravi@ximian.com>
140 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
141 (Invocation::BetterFunction): Implement.
142 (Invocation::BetterConversion): Implement.
143 (Invocation::ConversionExists): Skeleton, no implementation yet.
145 Okay, things work fine !
147 2001-09-21 Miguel de Icaza <miguel@ximian.com>
149 * typemanager.cs: declare and load enum_type, delegate_type and
152 * expression.cs (Expression::Emit): Now emit returns a value that
153 tells whether a value is left on the stack or not. This strategy
154 might be reveted tomorrow with a mechanism that would address
155 multiple assignments.
156 (Expression::report118): Utility routine to report mismatches on
159 (Unary::Report23): Report impossible type/operator combination
162 (Unary::IsIncrementableNumber): Whether the type can be
163 incremented or decremented with add.
164 (Unary::ResolveOperator): Also allow enumerations to be bitwise
166 (Unary::ResolveOperator): Implement ++, !, ~, ++ and --.
168 (Invocation::Emit): Deal with new Emit convetion.
170 * All Expression derivatives: Updated their Emit method to return
171 whether they leave values on the stack or not.
173 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
174 stack for expressions that are statements.
176 2001-09-20 Miguel de Icaza <miguel@ximian.com>
178 * expression.cs (LValue): New interface. Must be implemented by
180 (LocalVariableReference, ParameterReference, FieldExpr): Implement
183 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
184 interface for generating code, simplifies the code.
186 2001-09-20 Ravi Pratap <ravi@ximian.com>
188 * expression.cs (everywhere): Comment out return statements in ::Resolve
189 methods to avoid the warnings.
191 2001-09-20 Miguel de Icaza <miguel@ximian.com>
193 * driver.cs (parse): Report error 2001 if we can not open the
196 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
199 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
202 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
203 otherwise nested blocks end up with the same index.
205 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
207 * expression.cs: Instead of having FIXMEs in the Resolve
208 functions, throw exceptions so it is obvious that we are facing a
211 * cs-parser.jay (invocation_expression): Pass Location information.
213 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
214 Use a basename for those routines because .NET does not like paths
217 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
220 2001-09-19 Miguel de Icaza <miguel@ximian.com>
222 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
223 are loading the correct data types (throws an exception if not).
224 (TypeManager::InitCoreTypes): Use CoreLookupType
226 * expression.cs (Unary::ResolveOperator): return the child
227 expression for expressions which are just +expr.
228 (Unary::ResolveOperator): Return negative literals for -LITERAL
229 expressions (otherwise they are Unary {Literal}).
230 (Invocation::Badness): Take into account `Implicit constant
231 expression conversions'.
233 * literal.cs (LongLiteral): Implement long literal class.
234 (IntLiteral): export the `Value' of the intliteral.
236 2001-09-19 Ravi Pratap <ravi@ximian.com>
238 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
240 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
241 instead of 'Operator'
243 * expression.cs (Binary::ResolveOperator): Update accordingly.
244 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
247 * cs-parser.jay (unary_expression): Update to use the new names.
249 * gen-treedump.cs (GetUnary): Same here.
251 * expression.cs (Unary::Resolve): Implement.
252 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
253 operators are found instead of making noise ;-)
254 (Unary::ResolveOperator): New method to do precisely the same thing which
255 Binary::ResolveOperator does for Binary expressions.
256 (Unary.method, .Arguments): Add.
257 (Unary::OperName): Implement.
258 (Unary::ForceConversion): Copy and Paste !
260 * class.cs (Operator::Define): Fix a small bug for the case when we have
263 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
264 for the inbuilt operators. Only overloading works for now ;-)
266 2001-09-18 Miguel de Icaza <miguel@ximian.com>
268 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
269 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
271 * expression.cs (This::Emit): Implement.
272 (This::Resolve): Implement.
273 (TypeOf:Resolve): Implement.
274 (Expression::ResolveSimpleName): Add an implicit this to instance
276 (MemberAccess::Resolve): Deal with Parameters and Fields.
277 Bind instance variable to Field expressions.
278 (FieldExpr::Instance): New field used to track the expression that
279 represents the object instance.
280 (FieldExpr::Resolve): Track potential errors from MemberLookup not
282 (FieldExpr::Emit): Implement.
284 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
285 the last instruction contains a return opcode to avoid generating
286 the last `ret' instruction (this generates correct code, and it is
287 nice to pass the peverify output).
289 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
290 initializer for static and instance variables.
291 (Constructor::Emit): Allow initializer to be null in the case of
292 static constructors. Only emit initializer for instance
295 (TypeContainer::FindMembers): Return a null array if there are no
298 Also fix the code for the MemberTypes.Method branch, as it was not
299 scanning that for operators (or tried to access null variables before).
301 * assign.cs (Assign::Emit): Handle instance and static fields.
305 * driver.cs: Stop compilation if there are parse errors.
307 * cs-parser.jay (constructor_declaration): Provide default base
308 initializer for non-static constructors.
309 (constructor_declarator): Do not provide a default base
310 initializers if none was specified.
311 Catch the fact that constructors should not have parameters.
313 * class.cs: Do not emit parent class initializers for static
314 constructors, that should be flagged as an error.
316 2001-09-18 Ravi Pratap <ravi@ximian.com>
318 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
319 Move back code into TypeContainer::Populate.
321 2001-09-18 Ravi Pratap <ravi@ximian.com>
323 * class.cs (TypeContainer::AddConstructor): Fix the check to
324 compare against Name, not Basename.
325 (Operator::OpType): Change Plus and Minus to Add and Subtract.
327 * cs-parser.jay : Update accordingly.
329 * class.cs (TypeContainer::FindMembers): For the case where we are searching
330 for methods, don't forget to look into the operators too.
331 (RegisterMethodBuilder): Helper method to take care of this for
332 methods, constructors and operators.
333 (Operator::Define): Completely revamp.
334 (Operator.OperatorMethod, MethodName): New fields.
335 (TypeContainer::Populate): Move the registering of builders into
336 RegisterMethodBuilder.
337 (Operator::Emit): Re-write.
339 * expression.cs (Binary::Emit): Comment out code path to emit method
340 invocation stuff for the case when we have a user defined operator. I am
341 just not able to get it right !
343 2001-09-17 Miguel de Icaza <miguel@ximian.com>
345 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
348 (Expression::MemberLookup): Provide a version that allows to
349 specify the MemberTypes and BindingFlags.
351 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
352 so it was not fetching variable information from outer blocks.
354 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
355 Beforefieldinit as it was buggy.
357 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
360 * class.cs (Constructor::Emit): Only emit if block is not null.
361 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
362 deal with this by semantically definining it as if the user had
365 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
366 constructors as we now "emit" them at a higher level.
368 (TypeContainer::DefineDefaultConstructor): Used to define the
369 default constructors if none was provided.
371 (ConstructorInitializer): Add methods Resolve and Emit.
373 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
375 2001-09-17 Ravi Pratap <ravi@ximian.com>
377 * class.cs (TypeContainer::EmitDefaultConstructor): Register
378 the default constructor builder with our hashtable for methodbuilders
381 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
382 and argument_count is 0 in which case we have a match.
383 (Binary::ResolveOperator): More null checking and miscellaneous coding
386 2001-09-17 Ravi Pratap <ravi@ximian.com>
388 * rootcontext.cs (IsNameSpace): Compare against null.
390 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
392 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
395 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
398 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
399 we have overloaded operators.
400 (Binary::ResolveOperator): Implement the part which does the operator overload
403 * class.cs (Operator::Emit): Implement.
404 (TypeContainer::Emit): Emit the operators we have too.
406 * expression.cs (Binary::Emit): Update to emit the appropriate code for
407 the case when we have a user-defined operator.
409 2001-09-17 Miguel de Icaza <miguel@ximian.com>
411 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
413 2001-09-16 Ravi Pratap <ravi@ximian.com>
415 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
416 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
417 (Constructor::Emit): Implement.
418 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
419 if we have no work to do.
420 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
423 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
424 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
426 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
429 2001-09-15 Ravi Pratap <ravi@ximian.com>
431 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
433 (Tree::RecordNamespace): Method to do what the name says ;-)
434 (Tree::Namespaces): Property to get at the namespaces hashtable.
436 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
439 * rootcontext.cs (IsNamespace): Fixed it :-)
441 2001-09-14 Miguel de Icaza <miguel@ximian.com>
443 * class.cs (TypeContainer::FindMembers): Add support for
445 (MethodCore): New class that encapsulates both the shared aspects
446 of a Constructor and a Method.
447 (Method, Constructor): Factored pieces into MethodCore.
449 * driver.cs: Added --fatal which makes errors throw exceptions.
450 Load System assembly as well as part of the standard library.
452 * report.cs: Allow throwing exceptions on errors for debugging.
454 * modifiers.cs: Do not use `parent', instead use the real type
455 container to evaluate permission settings.
457 * class.cs: Put Ravi's patch back in. He is right, and we will
458 have to cope with the
460 2001-09-14 Ravi Pratap <ravi@ximian.com>
462 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
463 FamORAssem, not FamANDAssem.
465 2001-09-14 Miguel de Icaza <miguel@ximian.com>
467 * driver.cs: Added --parse option that only parses its input files
470 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
471 incorrect. IsTopLevel is not used to tell whether an object is
472 root_types or not (that can be achieved by testing this ==
473 root_types). But to see if this is a top-level *class* (not
474 necessarly our "toplevel" container).
476 2001-09-14 Ravi Pratap <ravi@ximian.com>
478 * enum.cs (Enum::Define): Modify to call the Lookup method on the
479 parent instead of a direct call to GetType.
481 2001-09-14 Ravi Pratap <ravi@ximian.com>
483 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
484 Modifiers.TypeAttr. This should just be a call to that method.
486 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
487 object so that we can determine if we are top-level or not.
489 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
492 * enum.cs (Enum::Define): Ditto.
494 * modifiers.cs (FieldAttr): Re-write.
496 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
497 (TypeContainer::HaveStaticConstructor): New property to provide access
498 to precisely that info.
500 * modifiers.cs (MethodAttr): Re-write.
501 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
503 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
504 of top-level types as claimed.
506 2001-09-13 Miguel de Icaza <miguel@ximian.com>
508 * expression.cs (MemberLookup): Fruitless attempt to lookup
509 constructors. Maybe I need to emit default constructors? That
510 might be it (currently .NET emits this for me automatically).
511 (Invocation::OverloadResolve): Cope with Arguments == null.
512 (Invocation::EmitArguments): new function, shared by the new
514 (Invocation::Emit): Handle static and instance methods. Emit
515 proper call instruction for virtual or non-virtual invocations.
516 (New::Emit): Implement.
517 (New::Resolve): Implement.
518 (MemberAccess:Resolve): Implement.
519 (MethodGroupExpr::InstanceExpression): used conforming to the spec
521 (FieldExpr::Resolve): Set type.
523 * support.cs: Handle empty arguments.
525 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
526 SimpleLookup): Auxiliary routines to help parse a qualifier
529 Update qualifier_identifier rule.
531 * codegen.cs: Removed debugging messages.
533 * class.cs: Make this a global thing, this acts just as a "key" to
534 objects that we might have around.
536 (Populate): Only initialize method_builders_to_methods once.
538 * expression.cs (PropertyExpr): Initialize type from the
541 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
542 Resolve pattern. Attempt to implicitly convert value to boolean.
545 * expression.cs: Set the type for the int32/int32 argument case.
546 (Binary::ResolveOperator): Set the return type to boolean for
547 comparission operators
549 * typemanager.cs: Remove debugging print code.
551 (Invocation::Resolve): resolve type.
553 * class.cs: Allocate a MemberInfo of the correct size, as the code
554 elsewhere depends on the test to reflect the correct contents.
556 (Method::) Keep track of parameters, due to System.Reflection holes
558 (TypeContainer::Populate): Keep track of MethodBuilders to Method
561 (TypeContainer::FindMembers): Use ArrayList and then copy an array
562 of the exact size and return that.
564 (Class::LookupMethodByBuilder): New function that maps
565 MethodBuilders to its methods. Required to locate the information
566 on methods because System.Reflection bit us again.
568 * support.cs: New file, contains an interface ParameterData and
569 two implementations: ReflectionParameters and InternalParameters
570 used to access Parameter information. We will need to grow this
573 * expression.cs (Invocation::GetParameterData): implement a cache
574 and a wrapper around the ParameterData creation for methods.
575 (Invocation::OverloadResolve): Use new code.
577 2001-09-13 Ravi Pratap <ravi@ximian.com>
579 * class.cs (TypeContainer::EmitField): Remove and move into
580 (Field::Define): here and modify accordingly.
581 (Field.FieldBuilder): New member.
582 (TypeContainer::Populate): Update accordingly.
583 (TypeContainer::FindMembers): Implement.
585 2001-09-13 Miguel de Icaza <miguel@ximian.com>
587 * statement.cs: (VariableInfo::VariableType): New field to be
588 initialized with the full type once it is resolved.
590 2001-09-12 Miguel de Icaza <miguel@ximian.com>
592 * parameter.cs (GetParameterInfo): Use a type cache to compute
593 things only once, and to reuse this information
595 * expression.cs (LocalVariableReference::Emit): Implement.
596 (OpcodeCast::Emit): fix.
598 (ParameterReference::Resolve): Implement.
599 (ParameterReference::Emit): Implement.
601 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
602 that are expressions need to stay as Expressions.
604 * typemanager.cs (CSharpName): Returns the C# name of a type if
607 * expression.cs (Expression::ConvertImplicit): New function that
608 implements implicit type conversions.
610 (Expression::ImplicitReferenceConversion): Implements implicit
611 reference conversions.
613 (EmptyCast): New type for transparent casts.
615 (OpcodeCast): New type for casts of types that are performed with
616 a sequence of bytecodes.
618 (BoxedCast): New type used for casting value types into reference
619 types. Emits a box opcode.
621 (Binary::DoNumericPromotions): Implements numeric promotions of
622 and computation of the Binary::Type.
624 (Binary::EmitBranchable): Optimization.
626 (Binary::Emit): Implement code emission for expressions.
628 * typemanager.cs (TypeManager): Added two new core types: sbyte
631 2001-09-12 Ravi Pratap <ravi@ximian.com>
633 * class.cs (TypeContainer::FindMembers): Method which does exactly
634 what Type.FindMembers does, only we don't have to use reflection. No
637 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
638 typecontainer objects as we need to get at them.
639 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
641 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
642 typecontainer object.
644 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
645 of just a Report object.
647 2001-09-11 Ravi Pratap <ravi@ximian.com>
649 * class.cs (Event::Define): Go back to using the prefixes "add_" and
651 (TypeContainer::Populate): Now define the delegates of the type too.
652 (TypeContainer.Delegates): Property to access the list of delegates defined
655 * delegates.cs (Delegate::Define): Implement partially.
657 * modifiers.cs (TypeAttr): Handle more flags.
659 2001-09-11 Ravi Pratap <ravi@ximian.com>
661 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
663 (Operator::Define): Re-write logic to get types by using the LookupType method
664 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
665 (Indexer::Define): Ditto.
666 (Event::Define): Ditto.
667 (Property::Define): Ditto.
669 2001-09-10 Ravi Pratap <ravi@ximian.com>
671 * class.cs (TypeContainer::Populate): Now define operators too.
672 (TypeContainer.Operators): New property to access the list of operators
674 (Operator.OperatorMethodBuilder): New member to hold the method builder
675 for the operator we are defining.
676 (Operator::Define): Implement.
678 2001-09-10 Ravi Pratap <ravi@ximian.com>
680 * class.cs (Event::Define): Make the prefixes of the accessor methods
683 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
684 of the location being passed in too. Ideally, this should go later since all
685 error reporting should be done through the Report object.
687 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
688 (Populate): Iterate thru the indexers we have and define them too.
689 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
690 for the get and set accessors.
691 (Indexer::Define): Implement.
693 2001-09-09 Miguel de Icaza <miguel@ximian.com>
695 * expression.cs (Binary::Resolve): Beginning of it. I scratched
696 my previous implementation, did not work.
698 * typemanager.cs: Add a couple of missing types (the longs).
700 * literal.cs: Use TypeManager.bool_type instead of getting it.
702 * expression.cs (EventExpr): New kind of expressions.
703 (Expressio::ExprClassFromMemberInfo): finish
705 2001-09-08 Miguel de Icaza <miguel@ximian.com>
707 * assign.cs: Emit stores to static fields differently.
709 2001-09-08 Ravi Pratap <ravi@ximian.com>
711 * Merge in changes and adjust code to tackle conflicts. Backed out my
712 code in Assign::Resolve ;-)
714 2001-09-08 Ravi Pratap <ravi@ximian.com>
716 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
717 instead Report.Error and also pass in the location.
718 (CSharpParser::Lexer): New readonly property to return the reference
719 to the Tokenizer object.
720 (declare_local_variables): Use Report.Error with location instead of plain
724 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
725 (Operator.CheckBinaryOperator): Ditto.
727 * cs-parser.jay (operator_declarator): Update accordingly.
729 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
730 (CheckBinaryOperator): Same here.
732 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
733 on the name without any prefixes of namespace names etc. This is because we
734 already might have something already fully qualified like
735 'System.Console.WriteLine'
737 * assign.cs (Resolve): Begin implementation. Stuck ;-)
739 2001-09-07 Ravi Pratap <ravi@ximian.com>
741 * cs-tokenizer.cs (location): Return a string which also contains
744 * expression.cs (ElementAccess): New class for expressions of the
745 type 'element access.'
746 (BaseAccess): New class for expressions of the type 'base access.'
747 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
750 * cs-parser.jay (element_access): Implement action.
751 (base_access): Implement actions.
752 (checked_expression, unchecked_expression): Implement.
754 * cs-parser.jay (local_variable_type): Correct and implement.
755 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
757 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
759 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
760 name and the specifiers.
762 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
764 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
765 making them all public ;-)
767 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
770 2001-09-07 Miguel de Icaza <miguel@ximian.com>
772 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
774 (FieldExpr, PropertyExprs): New resolved expressions.
775 (SimpleName::MemberStaticCheck): Perform static checks for access
776 to non-static fields on static methods. Maybe this should be
777 generalized for MemberAccesses.
778 (SimpleName::ResolveSimpleName): More work on simple name
781 * cs-parser.jay (primary_expression/qualified_identifier): track
784 * codegen.cs (CodeGen::Save): Catch save exception, report error.
785 (EmitContext::EmitBoolExpression): Chain to expression generation
786 instead of temporary hack.
787 (::EmitStatementExpression): Put generic expression code generation.
789 * assign.cs (Assign::Emit): Implement variable assignments to
790 local variables, parameters and fields.
792 2001-09-06 Miguel de Icaza <miguel@ximian.com>
794 * statement.cs (Block::GetVariableInfo): New method, returns the
795 VariableInfo for a variable name in a block.
796 (Block::GetVariableType): Implement in terms of GetVariableInfo
798 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
799 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
801 2001-09-06 Ravi Pratap <ravi@ximian.com>
803 * cs-parser.jay (operator_declaration): Continue on my quest : update
804 to take attributes argument.
805 (event_declaration): Ditto.
806 (enum_declaration): Ditto.
807 (indexer_declaration): Ditto.
809 * class.cs (Operator::Operator): Update constructor accordingly.
810 (Event::Event): Ditto.
812 * delegate.cs (Delegate::Delegate): Same here.
814 * enum.cs (Enum::Enum): Same here.
816 2001-09-05 Ravi Pratap <ravi@ximian.com>
818 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
820 * ../tests/cs0658.cs : New file to demonstrate error 0658.
822 * attribute.cs (Attributes): New class to encapsulate all attributes which were
823 being passed around as an arraylist.
824 (Attributes::AddAttribute): Method to add attribute sections.
826 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
827 (struct_declaration): Update accordingly.
828 (constant_declaration): Update.
829 (field_declaration): Update.
830 (method_header): Update.
831 (fixed_parameter): Update.
832 (parameter_array): Ditto.
833 (property_declaration): Ditto.
834 (destructor_declaration): Ditto.
836 * class.cs (Struct::Struct): Update constructors accordingly.
837 (Class::Class): Ditto.
838 (Field::Field): Ditto.
839 (Method::Method): Ditto.
840 (Property::Property): Ditto.
841 (TypeContainer::OptAttribute): update property's return type.
843 * interface.cs (Interface.opt_attributes): New member.
844 (Interface::Interface): Update to take the extra Attributes argument.
846 * parameter.cs (Parameter::Parameter): Ditto.
848 * constant.cs (Constant::Constant): Ditto.
850 * interface.cs (InterfaceMemberBase): New OptAttributes field.
851 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
852 the attributes as a parameter.
853 (InterfaceProperty): Update constructor call.
854 (InterfaceEvent): Ditto.
855 (InterfaceMethod): Ditto.
856 (InterfaceIndexer): Ditto.
858 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
859 pass the attributes too.
860 (interface_event_declaration): Ditto.
861 (interface_property_declaration): Ditto.
862 (interface_method_declaration): Ditto.
863 (interface_declaration): Ditto.
865 2001-09-05 Miguel de Icaza <miguel@ximian.com>
867 * class.cs (Method::Define): Track the "static Main" definition to
868 create an entry point.
870 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
871 EntryPoint if we find it.
873 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
874 (EmitContext::ig): Make this variable public.
876 * driver.cs: Make the default output file be the first file name
877 with the .exe extension.
879 Detect empty compilations
881 Handle various kinds of output targets. Handle --target and
882 rename -t to --dumper.
884 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
885 methods inherited from Expression return now an Expression. This
886 will is used during the tree rewriting as we resolve them during
889 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
890 the spec. Missing entirely is the information about
891 accessability of elements of it.
893 (Expression::ExprClassFromMemberInfo): New constructor for
894 Expressions that creates a fully initialized Expression based on
895 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
898 (Invocation::Resolve): Begin implementing resolution of invocations.
900 * literal.cs (StringLiteral): Implement Emit.
902 2001-09-05 Ravi Pratap <ravi@ximian.com>
904 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
907 2001-09-04 Ravi Pratap <ravi@ximian.com>
909 * cs-parser.jay (attribute_arguments): Implement actions.
910 (attribute): Fix bug in production. Implement action.
911 (attribute_list): Implement.
912 (attribute_target): Implement.
913 (attribute_target_specifier, opt_target_specifier): Implement
914 (CheckAttributeTarget): New method to check if the attribute target
916 (attribute_section): Implement.
917 (opt_attributes): Implement.
919 * attribute.cs : New file to handle attributes.
920 (Attribute): Class to hold attribute info.
922 * cs-parser.jay (opt_attribute_target_specifier): Remove production
923 (attribute_section): Modify production to use 2 different rules to
924 achieve the same thing. 1 s/r conflict down !
925 Clean out commented, useless, non-reducing dimension_separator rules.
927 * class.cs (TypeContainer.attributes): New member to hold list
928 of attributes for a type.
929 (Struct::Struct): Modify to take one more argument, the attribute list.
930 (Class::Class): Ditto.
931 (Field::Field): Ditto.
932 (Method::Method): Ditto.
933 (Property::Property): Ditto.
935 * cs-parser.jay (struct_declaration): Update constructor call to
936 pass in the attributes too.
937 (class_declaration): Ditto.
938 (constant_declaration): Ditto.
939 (field_declaration): Ditto.
940 (method_header): Ditto.
941 (fixed_parameter): Ditto.
942 (parameter_array): Ditto.
943 (property_declaration): Ditto.
945 * constant.cs (Constant::Constant): Update constructor similarly.
946 Use System.Collections.
948 * parameter.cs (Parameter::Parameter): Update as above.
950 2001-09-02 Ravi Pratap <ravi@ximian.com>
952 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
953 (TypeContainer.delegates): New member to hold list of delegates.
955 * cs-parser.jay (delegate_declaration): Implement the action correctly
956 this time as I seem to be on crack ;-)
958 2001-09-02 Miguel de Icaza <miguel@ximian.com>
960 * rootcontext.cs (RootContext::IsNamespace): new function, used to
961 tell whether an identifier represents a namespace.
963 * expression.cs (NamespaceExpr): A namespace expression, used only
964 temporarly during expression resolution.
965 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
966 utility functions to resolve names on expressions.
968 2001-09-01 Miguel de Icaza <miguel@ximian.com>
970 * codegen.cs: Add hook for StatementExpressions.
972 * class.cs: Fix inverted test for static flag in methods.
974 2001-09-02 Ravi Pratap <ravi@ximian.com>
976 * class.cs (Operator::CheckUnaryOperator): Correct error number used
977 to make it coincide with MS' number.
978 (Operator::CheckBinaryOperator): Ditto.
980 * ../errors/errors.txt : Remove error numbers added earlier.
982 * ../errors/cs1019.cs : Test case for error # 1019
984 * ../errros/cs1020.cs : Test case for error # 1020
986 * cs-parser.jay : Clean out commented cruft.
987 (dimension_separators, dimension_separator): Comment out. Ostensibly not
988 used anywhere - non-reducing rule.
989 (namespace_declarations): Non-reducing rule - comment out.
991 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
992 with TypeContainer::AddEnum.
994 * delegate.cs : New file for delegate handling classes.
995 (Delegate): Class for declaring delegates.
999 * cs-parser.jay (delegate_declaration): Implement.
1001 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
1003 * class.cs (Event::Define): Implement.
1004 (Event.EventBuilder): New member.
1006 * class.cs (TypeContainer::Populate): Update to define all enums and events
1008 (Events): New property for the events arraylist we hold. Shouldn't we move to using
1009 readonly fields for all these cases ?
1011 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
1013 * class.cs (Property): Revamp to use the convention of making fields readonly.
1014 Accordingly modify code elsewhere.
1016 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
1017 the Define method of the Property class.
1019 * class.cs : Clean up applied patch and update references to variables etc. Fix
1021 (TypeContainer::Populate): Update to define all the properties we have. Also
1022 define all enumerations.
1024 * enum.cs (Define): Implement.
1026 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
1028 * cs-parser.jay (overloadable_operator): The semantic value is an
1029 enum of the Operator class.
1030 (operator_declarator): Implement actions.
1031 (operator_declaration): Implement.
1033 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
1034 validity of definitions.
1035 (Operator::CheckBinaryOperator): Static method to check for binary operators
1036 (TypeContainer::AddOperator): New method to add an operator to a type.
1038 * cs-parser.jay (indexer_declaration): Added line to actually call the
1039 AddIndexer method so it gets added ;-)
1041 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
1042 already taken care of by the MS compiler ?
1044 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
1046 * class.cs (Operator): New class for operator declarations.
1047 (Operator::OpType): Enum for the various operators.
1049 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
1051 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
1052 ostensibly handle this in semantic analysis.
1054 * cs-parser.jay (general_catch_clause): Comment out
1055 (specific_catch_clauses, specific_catch_clause): Ditto.
1056 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
1057 (catch_args, opt_catch_args): New productions.
1058 (catch_clause): Rewrite to use the new productions above
1059 (catch_clauses): Modify accordingly.
1060 (opt_catch_clauses): New production to use in try_statement
1061 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
1062 and re-write the code in the actions to extract the specific and
1063 general catch clauses by being a little smart ;-)
1065 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
1066 Hooray, try and catch statements parse fine !
1068 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1070 * statement.cs (Block::GetVariableType): Fix logic to extract the type
1071 string from the hashtable of variables.
1073 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
1074 I end up making that mistake ;-)
1075 (catch_clauses): Fixed gross error which made Key and Value of the
1076 DictionaryEntry the same : $1 !!
1078 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1080 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
1082 * cs-parser.jay (event_declaration): Correct to remove the semicolon
1083 when the add and remove accessors are specified.
1085 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1087 * cs-parser.jay (IndexerDeclaration): New helper class to hold
1088 information about indexer_declarator.
1089 (indexer_declarator): Implement actions.
1090 (parsing_indexer): New local boolean used to keep track of whether
1091 we are parsing indexers or properties. This is necessary because
1092 implicit_parameters come into picture even for the get accessor in the
1094 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
1096 * class.cs (Indexer): New class for indexer declarations.
1097 (TypeContainer::AddIndexer): New method to add an indexer to a type.
1098 (TypeContainer::indexers): New member to hold list of indexers for the
1101 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
1103 * cs-parser.jay (add_accessor_declaration): Implement action.
1104 (remove_accessor_declaration): Implement action.
1105 (event_accessors_declaration): Implement
1106 (variable_declarators): swap statements for first rule - trivial.
1108 * class.cs (Event): New class to hold information about event
1110 (TypeContainer::AddEvent): New method to add an event to a type
1111 (TypeContainer::events): New member to hold list of events.
1113 * cs-parser.jay (event_declaration): Implement actions.
1115 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
1117 * cs-parser.jay (dim_separators): Implement. Make it a string
1118 concatenating all the commas together, just as they appear.
1119 (opt_dim_separators): Modify accordingly
1120 (rank_specifiers): Update accordingly. Basically do the same
1121 thing - instead, collect the brackets here.
1122 (opt_rank_sepcifiers): Modify accordingly.
1123 (array_type): Modify to actually return the complete type string
1124 instead of ignoring the rank_specifiers.
1125 (expression_list): Implement to collect the expressions
1126 (variable_initializer): Implement. We make it a list of expressions
1127 essentially so that we can handle the array_initializer case neatly too.
1128 (variable_initializer_list): Implement.
1129 (array_initializer): Make it a list of variable_initializers
1130 (opt_array_initializer): Modify accordingly.
1132 * expression.cs (New::NType): Add enumeration to help us
1133 keep track of whether we have an object/delegate creation
1134 or an array creation.
1135 (New:NewType, New::Rank, New::Indices, New::Initializers): New
1136 members to hold data about array creation.
1137 (New:New): Modify to update NewType
1138 (New:New): New Overloaded contructor for the array creation
1141 * cs-parser.jay (array_creation_expression): Implement to call
1142 the overloaded New constructor.
1144 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
1146 * class.cs (TypeContainer::Constructors): Return member
1147 constructors instead of returning null.
1149 2001-08-26 Miguel de Icaza <miguel@ximian.com>
1151 * typemanager.cs (InitCoreTypes): Initialize the various core
1152 types after we have populated the type manager with the user
1153 defined types (this distinction will be important later while
1154 compiling corlib.dll)
1156 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
1157 on Expression Classification. Now all expressions have a method
1158 `Resolve' and a method `Emit'.
1160 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
1161 generation from working. Also add some temporary debugging
1164 2001-08-24 Miguel de Icaza <miguel@ximian.com>
1166 * codegen.cs: Lots of code generation pieces. This is only the
1167 beginning, will continue tomorrow with more touches of polish. We
1168 handle the fundamentals of if, while, do, for, return. Others are
1169 trickier and I need to start working on invocations soon.
1171 * gen-treedump.cs: Bug fix, use s.Increment here instead of
1174 * codegen.cs (EmitContext): New struct, used during code
1175 emission to keep a context. Most of the code generation will be
1178 * cs-parser.jay: Add embedded blocks to the list of statements of
1179 this block. So code generation proceeds in a top down fashion.
1181 2001-08-23 Miguel de Icaza <miguel@ximian.com>
1183 * statement.cs: Add support for multiple child blocks.
1185 2001-08-22 Miguel de Icaza <miguel@ximian.com>
1187 * codegen.cs (EmitCode): New function, will emit the code for a
1188 Block of code given a TypeContainer and its ILGenerator.
1190 * statement.cs (Block): Standard public readonly optimization.
1191 (Block::Block constructors): Link children.
1192 (Block::Child): Child Linker.
1193 (Block::EmitVariables): Emits IL variable declarations.
1195 * class.cs: Drop support for MethodGroups here, delay until
1197 (Method::): Applied the same simplification that I did before, and
1198 move from Properties to public readonly fields.
1199 (Method::ParameterTypes): Returns the parameter types for the
1200 function, and implements a cache that will be useful later when I
1201 do error checking and the semantic analysis on the methods is
1203 (Constructor::GetCallingConvention): Renamed from CallingConvetion
1204 and made a method, optional argument tells whether this is a class
1205 or a structure to apply the `has-this' bit.
1206 (Method::GetCallingConvention): Implement, returns the calling
1208 (Method::Define): Defines the type, a second pass is performed
1209 later to populate the methods.
1211 (Constructor::ParameterTypes): implement a cache similar to the
1212 one on Method::ParameterTypes, useful later when we do semantic
1215 (TypeContainer::EmitMethod): New method. Emits methods.
1217 * expression.cs: Removed MethodGroup class from here.
1219 * parameter.cs (Parameters::GetCallingConvention): new method.
1221 2001-08-21 Miguel de Icaza <miguel@ximian.com>
1223 * class.cs (TypeContainer::Populate): Drop RootContext from the
1226 (Constructor::CallingConvention): Returns the calling convention.
1227 (Constructor::ParameterTypes): Returns the constructor parameter
1230 (TypeContainer::AddConstructor): Keep track of default constructor
1231 and the default static constructor.
1233 (Constructor::) Another class that starts using `public readonly'
1234 instead of properties.
1236 (Constructor::IsDefault): Whether this is a default constructor.
1238 (Field::) use readonly public fields instead of properties also.
1240 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
1241 track of static constructors; If none is used, turn on
1242 BeforeFieldInit in the TypeAttributes.
1244 * cs-parser.jay (opt_argument_list): now the return can be null
1245 for the cases where there are no arguments.
1247 (constructor_declarator): If there is no implicit `base' or
1248 `this', then invoke the default parent constructor.
1250 * modifiers.cs (MethodAttr): New static function maps a set of
1251 modifiers flags into a MethodAttributes enum
1252 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
1253 MethodAttr, TypeAttr to represent the various mappings where the
1255 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
1257 2001-08-19 Miguel de Icaza <miguel@ximian.com>
1259 * parameter.cs (GetParameterInfo): Fix bug where there would be no
1262 * interface.cs (PopulateIndexer): Implemented the code generator
1263 for interface indexers.
1265 2001-08-17 Miguel de Icaza <miguel@ximian.com>
1267 * interface.cs (InterfaceMemberBase): Now we track the new status
1270 (PopulateProperty): Implement property population. Woohoo! Got
1271 Methods and Properties going today.
1273 Removed all the properties for interfaces, and replaced them with
1274 `public readonly' fields.
1276 2001-08-16 Miguel de Icaza <miguel@ximian.com>
1278 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
1279 initialize their hashtables/arraylists only when they are needed
1280 instead of doing this always.
1282 * parameter.cs: Handle refs and out parameters.
1284 * cs-parser.jay: Use an ArrayList to construct the arguments
1285 instead of the ParameterCollection, and then cast that to a
1288 * parameter.cs: Drop the use of ParameterCollection and use
1289 instead arrays of Parameters.
1291 (GetParameterInfo): Use the Type, not the Name when resolving
1294 2001-08-13 Miguel de Icaza <miguel@ximian.com>
1296 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
1297 and instead use public readonly fields.
1299 * class.cs: Put back walking code for type containers.
1301 2001-08-11 Miguel de Icaza <miguel@ximian.com>
1303 * class.cs (MakeConstant): Code to define constants.
1305 * rootcontext.cs (LookupType): New function. Used to locate types
1308 2001-08-08 Miguel de Icaza <miguel@ximian.com>
1310 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
1311 this System.Reflection code is. Kudos to Microsoft
1313 * typemanager.cs: Implement a type cache and avoid loading all
1314 types at boot time. Wrap in LookupType the internals. This made
1315 the compiler so much faster. Wow. I rule!
1317 * driver.cs: Make sure we always load mscorlib first (for
1318 debugging purposes, nothing really important).
1320 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
1321 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
1323 * rootcontext.cs: Lookup types on their namespace; Lookup types
1324 on namespaces that have been imported using the `using' keyword.
1326 * class.cs (TypeContainer::TypeAttr): Virtualize.
1327 (Class::TypeAttr): Return attributes suitable for this bad boy.
1328 (Struct::TypeAttr): ditto.
1329 Handle nested classes.
1330 (TypeContainer::) Remove all the type visiting code, it is now
1331 replaced with the rootcontext.cs code
1333 * rootcontext.cs (GetClassBases): Added support for structs.
1335 2001-08-06 Miguel de Icaza <miguel@ximian.com>
1337 * interface.cs, statement.cs, class.cs, parameter.cs,
1338 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
1339 Drop use of TypeRefs, and use strings instead.
1341 2001-08-04 Miguel de Icaza <miguel@ximian.com>
1345 * class.cs (Struct::Struct): set the SEALED flags after
1346 checking the modifiers.
1347 (TypeContainer::TypeAttr): new property, returns the
1348 TypeAttributes for a class.
1350 * cs-parser.jay (type_list): Oops, list production was creating a
1351 new list of base types.
1353 * rootcontext.cs (StdLib): New property.
1354 (GetInterfaceTypeByName): returns an interface by type name, and
1355 encapsulates error handling here.
1356 (GetInterfaces): simplified.
1357 (ResolveTree): Encapsulated all the tree resolution here.
1358 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
1361 * driver.cs: Add support for --nostdlib, to avoid loading the
1363 (Main): Do not put tree resolution here.
1365 * rootcontext.cs: Beginning of the class resolution.
1367 2001-08-03 Miguel de Icaza <miguel@ximian.com>
1369 * rootcontext.cs: Provide better error reporting.
1371 * cs-parser.jay (interface_base): set our $$ to be interfaces.
1373 * rootcontext.cs (CreateInterface): Handle the case where there
1374 are no parent interfaces.
1376 (CloseTypes): Routine to flush types at the end.
1377 (CreateInterface): Track types.
1378 (GetInterfaces): Returns an array of Types from the list of
1381 * typemanager.c (AddUserType): Mechanism to track user types (puts
1382 the type on the global type hash, and allows us to close it at the
1385 2001-08-02 Miguel de Icaza <miguel@ximian.com>
1387 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
1388 RecordInterface instead.
1390 * cs-parser.jay: Updated to reflect changes above.
1392 * decl.cs (Definition): Keep track of the TypeBuilder type that
1393 represents this type here. Not sure we will use it in the long
1394 run, but wont hurt for now.
1396 * driver.cs: Smaller changes to accomodate the new code.
1398 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
1401 * rootcontext.cs (CreateInterface): New method, used to create
1402 the System.TypeBuilder type for interfaces.
1403 (ResolveInterfaces): new entry point to resolve the interface
1405 (CodeGen): Property, used to keep track of the code generator.
1407 2001-07-26 Miguel de Icaza <miguel@ximian.com>
1409 * cs-parser.jay: Add a second production for delegate_declaration
1412 (enum_body): Put an opt_comma here instead of putting it on
1413 enum_body or enum_member_declarations so we can handle trailing
1414 commas on enumeration members. Gets rid of a shift/reduce.
1416 (type_list): Need a COMMA in the middle.
1418 (indexer_declaration): Tell tokenizer to recognize get/set
1420 * Remove old targets.
1422 * Re-add the parser target.
1424 2001-07-13 Simon Cozens <simon@simon-cozens.org>
1426 * cs-parser.jay: Add precendence rules for a number of operators
1427 ot reduce the number of shift/reduce conflicts in the grammar.
1429 2001-07-17 Miguel de Icaza <miguel@ximian.com>
1431 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
1434 Get rid of old crufty code.
1436 * rootcontext.cs: Use this to keep track of the parsed
1437 representation and the defined types available to the program.
1439 * gen-treedump.cs: adjust for new convention.
1441 * type.cs: Split out the type manager, and the assembly builder
1444 * typemanager.cs: the type manager will live here now.
1446 * cil-codegen.cs: And the code generator here.
1448 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
1450 * makefile: Fixed up for easy making.
1452 2001-07-13 Simon Cozens <simon@simon-cozens.org>
1454 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
1457 (unary_expression): Expand pre_increment_expression and
1458 post_decrement_expression to reduce a shift/reduce.
1460 2001-07-11 Simon Cozens
1462 * cs-tokenizer.cs: Hex numbers should begin with a 0.
1464 Improve allow_keyword_as_indent name.
1466 2001-06-19 Miguel de Icaza <miguel@ximian.com>
1468 * Adjustments for Beta2.
1470 2001-06-13 Miguel de Icaza <miguel@ximian.com>
1472 * decl.cs: Added `Define' abstract method.
1473 (InTransit): new property, used to catch recursive definitions.
1475 * interface.cs: Implement `Define'.
1477 * modifiers.cs: Map Modifiers.constants to
1478 System.Reflection.TypeAttribute flags.
1480 * class.cs: Keep track of types and user-defined types.
1481 (BuilderInit): New method for creating an assembly
1482 (ResolveType): New function to launch the resolution process, only
1483 used by interfaces for now.
1485 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
1486 that are inserted into the name space.
1488 2001-06-08 Miguel de Icaza <miguel@ximian.com>
1490 * ARGH. I have screwed up my tree so many times due to the use of
1491 rsync rather than using CVS. Going to fix this at once.
1493 * driver.cs: Objetify driver. Load assemblies, use assemblies to
1496 2001-06-07 Miguel de Icaza <miguel@ximian.com>
1498 * Experiment successful: Use System.Type rather that our own
1501 2001-05-25 Miguel de Icaza <miguel@ximian.com>
1503 * cs-parser.jay: Removed nsAliases from here.
1505 Use new namespaces, handle `using XXX;'
1507 * namespace.cs: Reimplemented namespace handling, use a recursive
1508 definition of the class. Now we can keep track of using clauses
1509 and catch invalid using clauses.
1511 2001-05-24 Miguel de Icaza <miguel@ximian.com>
1513 * gen-treedump.cs: Adapted for all the renaming.
1515 * expression.cs (Expression): this class now has a Type property
1516 which returns an expression Type.
1518 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
1519 `Type', as this has a different meaning now in the base
1521 2001-05-22 Miguel de Icaza <miguel@ximian.com>
1523 * interface.cs, class.cs: Removed from all the sources the
1524 references to signature computation, as we can not do method
1525 signature computation during the parsing time, as we are not
1526 trying to solve at that point distinguishing:
1530 void a (NS.Blah x) {}
1533 Which depending on the context might be valid or not, as we do not
1534 know if Blah is the same thing as NS.Blah at that point.
1536 * Redid everything so the code uses TypeRefs now instead of
1537 Types. TypeRefs are just temporary type placeholders, that need
1538 to be resolved. They initially have a pointer to a string and the
1539 current scope in which they are used. This is used later by the
1540 compiler to resolve the reference to an actual Type.
1542 * DeclSpace is no longer a CIR.Type, and neither are
1543 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
1544 are all DeclSpaces, but no Types.
1546 * type.cs (TypeRefManager): This implements the TypeRef manager,
1547 which keeps track of all the types that need to be resolved after
1548 the parsing has finished.
1550 2001-05-13 Miguel de Icaza <miguel@ximian.com>
1552 * ARGH. We are going to have to store `foreach' as a class rather
1553 than resolving it, as we need to verify error 1579 after name
1554 resolution. *OR* we could keep a flag that says `This request to
1555 IEnumerator comes from a foreach statement' which we can then use
1556 to generate the error.
1558 2001-05-10 Miguel de Icaza <miguel@ximian.com>
1560 * class.cs (TypeContainer.AddMethod): we now add methods to the
1561 MethodGroup instead of the method hashtable.
1563 * expression.cs: Add MethodGroup abstraction, which gets us one
1564 step closer to the specification in the way we handle method
1567 * cs-parser.jay (primary_expression): qualified_identifier now
1568 tried to match up an identifier to a local variable reference or
1569 to a parameter reference.
1571 current_local_parameters is now a parser global variable that
1572 points to the current parameters for the block, used during name
1575 (property_declaration): Now creates an implicit `value' argument to
1578 2001-05-09 Miguel de Icaza <miguel@ximian.com>
1580 * parameter.cs: Do not use `param' arguments as part of the
1581 signature, per the spec.
1583 2001-05-08 Miguel de Icaza <miguel@ximian.com>
1585 * decl.cs: Base class for classes, structs and interfaces. This
1586 is the "Declaration Space"
1588 * cs-parser.jay: Use CheckDef for checking declaration errors
1589 instead of having one on each function.
1591 * class.cs: Factor out some code for handling error handling in
1592 accordance to the "Declarations" section in the "Basic Concepts"
1593 chapter in the ECMA C# spec.
1595 * interface.cs: Make all interface member classes derive from
1596 InterfaceMemberBase.
1598 2001-05-07 Miguel de Icaza <miguel@ximian.com>
1600 * Many things: all interfaces are parsed and generated in
1601 gen-treedump. Support for member variables, constructors,
1602 destructors, properties, constants is there.
1604 Beginning of the IL backend, but very little done, just there for
1607 2001-04-29 Miguel de Icaza <miguel@ximian.com>
1609 * cs-parser.jay: Fix labeled statement.
1611 * cs-tokenizer.cs (escape): Escape " and ' always.
1612 ref_line, ref_name: keep track of the line/filename as instructed
1613 by #line by the compiler.
1616 2001-04-27 Miguel de Icaza <miguel@ximian.com>
1618 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
1619 to match the values in System.CodeDOM.
1621 Divid renamed to Divide.
1623 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
1625 (Statements.set): remove.
1627 * System.CodeDOM/CodeCatchClause.cs: always have a valid
1630 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
1631 falseStatements always have valid values.
1633 * cs-parser.jay: Use System.CodeDOM now.