1 2001-09-25 Ravi Pratap <ravi@ximian.com>
3 * expression.cs (Binary::ResolveOperator): Had forgottten to set
4 the type of the expression to the return type of the method if
5 we have an overloaded operator match ! The regression tests pass again !
6 (Unary::ResolveOperator): Ditto.
8 * expression.cs (Invocation::ConversionExists): Correct the member lookup
9 to find "op_Implicit", not "implicit" ;-)
10 (UserImplicitCast): New class to take care of user-defined implicit conversions.
11 (ConvertImplicit, ForceConversion): Take TypeContainer argument
13 * everywhere : Correct calls to the above accordingly.
15 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
16 (ConvertImplicit): Do user-defined conversion if it exists.
18 2001-09-24 Miguel de Icaza <miguel@ximian.com>
20 * assign.cs: track location.
21 (Resolve): Use implicit conversions on assignment.
23 * literal.cs: Oops. Not good, Emit of short access values should
24 pass (Bytes) or the wrong argument will be selected.
26 * expression.cs (Unary::Emit): Emit code for -expr.
28 (Unary::ResolveOperator): Handle `Substract' for non-constants
29 (substract from zero from the non-constants).
30 Deal with Doubles as well.
32 (Expression::ConvertImplicitRequired): New routine that reports an
33 error if no implicit conversion exists.
35 (Invocation::OverloadResolve): Store the converted implicit
36 expressions if we make them
38 2001-09-24 Ravi Pratap <ravi@ximian.com>
40 * class.cs (ConstructorInitializer): Take a Location argument.
41 (ConstructorBaseInitializer): Same here.
42 (ConstructorThisInitializer): Same here.
44 * cs-parser.jay : Update all calls accordingly.
46 * expression.cs (Unary, Binary, New): Take location argument.
47 Update accordingly everywhere.
49 * cs-parser.jay : Update all calls to the above to take a location
54 2001-09-24 Ravi Pratap <ravi@ximian.com>
56 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
57 (Invocation::BetterConversion): Same here
58 (Invocation::ConversionExists): Ditto.
60 (Invocation::ConversionExists): Implement.
62 2001-09-22 Ravi Pratap <ravi@ximian.com>
64 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
65 Also take an additional TypeContainer argument.
67 * All over : Pass in TypeContainer as argument to OverloadResolve.
69 * typemanager.cs (CSharpName): Update to check for the string type and return
72 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
75 2001-09-21 Ravi Pratap <ravi@ximian.com>
77 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
78 (Invocation::BetterFunction): Implement.
79 (Invocation::BetterConversion): Implement.
80 (Invocation::ConversionExists): Skeleton, no implementation yet.
82 Okay, things work fine !
84 2001-09-21 Miguel de Icaza <miguel@ximian.com>
86 * typemanager.cs: declare and load enum_type, delegate_type and
89 * expression.cs (Expression::Emit): Now emit returns a value that
90 tells whether a value is left on the stack or not. This strategy
91 might be reveted tomorrow with a mechanism that would address
93 (Expression::report118): Utility routine to report mismatches on
96 (Unary::Report23): Report impossible type/operator combination
99 (Unary::IsIncrementableNumber): Whether the type can be
100 incremented or decremented with add.
101 (Unary::ResolveOperator): Also allow enumerations to be bitwise
103 (Unary::ResolveOperator): Implement ++, !, ~, ++ and --.
105 (Invocation::Emit): Deal with new Emit convetion.
107 * All Expression derivatives: Updated their Emit method to return
108 whether they leave values on the stack or not.
110 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
111 stack for expressions that are statements.
113 2001-09-20 Miguel de Icaza <miguel@ximian.com>
115 * expression.cs (LValue): New interface. Must be implemented by
117 (LocalVariableReference, ParameterReference, FieldExpr): Implement
120 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
121 interface for generating code, simplifies the code.
123 2001-09-20 Ravi Pratap <ravi@ximian.com>
125 * expression.cs (everywhere): Comment out return statements in ::Resolve
126 methods to avoid the warnings.
128 2001-09-20 Miguel de Icaza <miguel@ximian.com>
130 * driver.cs (parse): Report error 2001 if we can not open the
133 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
136 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
139 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
140 otherwise nested blocks end up with the same index.
142 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
144 * expression.cs: Instead of having FIXMEs in the Resolve
145 functions, throw exceptions so it is obvious that we are facing a
148 * cs-parser.jay (invocation_expression): Pass Location information.
150 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
151 Use a basename for those routines because .NET does not like paths
154 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
157 2001-09-19 Miguel de Icaza <miguel@ximian.com>
159 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
160 are loading the correct data types (throws an exception if not).
161 (TypeManager::InitCoreTypes): Use CoreLookupType
163 * expression.cs (Unary::ResolveOperator): return the child
164 expression for expressions which are just +expr.
165 (Unary::ResolveOperator): Return negative literals for -LITERAL
166 expressions (otherwise they are Unary {Literal}).
167 (Invocation::Badness): Take into account `Implicit constant
168 expression conversions'.
170 * literal.cs (LongLiteral): Implement long literal class.
171 (IntLiteral): export the `Value' of the intliteral.
173 2001-09-19 Ravi Pratap <ravi@ximian.com>
175 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
177 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
178 instead of 'Operator'
180 * expression.cs (Binary::ResolveOperator): Update accordingly.
181 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
184 * cs-parser.jay (unary_expression): Update to use the new names.
186 * gen-treedump.cs (GetUnary): Same here.
188 * expression.cs (Unary::Resolve): Implement.
189 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
190 operators are found instead of making noise ;-)
191 (Unary::ResolveOperator): New method to do precisely the same thing which
192 Binary::ResolveOperator does for Binary expressions.
193 (Unary.method, .Arguments): Add.
194 (Unary::OperName): Implement.
195 (Unary::ForceConversion): Copy and Paste !
197 * class.cs (Operator::Define): Fix a small bug for the case when we have
200 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
201 for the inbuilt operators. Only overloading works for now ;-)
203 2001-09-18 Miguel de Icaza <miguel@ximian.com>
205 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
206 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
208 * expression.cs (This::Emit): Implement.
209 (This::Resolve): Implement.
210 (TypeOf:Resolve): Implement.
211 (Expression::ResolveSimpleName): Add an implicit this to instance
213 (MemberAccess::Resolve): Deal with Parameters and Fields.
214 Bind instance variable to Field expressions.
215 (FieldExpr::Instance): New field used to track the expression that
216 represents the object instance.
217 (FieldExpr::Resolve): Track potential errors from MemberLookup not
219 (FieldExpr::Emit): Implement.
221 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
222 the last instruction contains a return opcode to avoid generating
223 the last `ret' instruction (this generates correct code, and it is
224 nice to pass the peverify output).
226 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
227 initializer for static and instance variables.
228 (Constructor::Emit): Allow initializer to be null in the case of
229 static constructors. Only emit initializer for instance
232 (TypeContainer::FindMembers): Return a null array if there are no
235 Also fix the code for the MemberTypes.Method branch, as it was not
236 scanning that for operators (or tried to access null variables before).
238 * assign.cs (Assign::Emit): Handle instance and static fields.
242 * driver.cs: Stop compilation if there are parse errors.
244 * cs-parser.jay (constructor_declaration): Provide default base
245 initializer for non-static constructors.
246 (constructor_declarator): Do not provide a default base
247 initializers if none was specified.
248 Catch the fact that constructors should not have parameters.
250 * class.cs: Do not emit parent class initializers for static
251 constructors, that should be flagged as an error.
253 2001-09-18 Ravi Pratap <ravi@ximian.com>
255 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
256 Move back code into TypeContainer::Populate.
258 2001-09-18 Ravi Pratap <ravi@ximian.com>
260 * class.cs (TypeContainer::AddConstructor): Fix the check to
261 compare against Name, not Basename.
262 (Operator::OpType): Change Plus and Minus to Add and Subtract.
264 * cs-parser.jay : Update accordingly.
266 * class.cs (TypeContainer::FindMembers): For the case where we are searching
267 for methods, don't forget to look into the operators too.
268 (RegisterMethodBuilder): Helper method to take care of this for
269 methods, constructors and operators.
270 (Operator::Define): Completely revamp.
271 (Operator.OperatorMethod, MethodName): New fields.
272 (TypeContainer::Populate): Move the registering of builders into
273 RegisterMethodBuilder.
274 (Operator::Emit): Re-write.
276 * expression.cs (Binary::Emit): Comment out code path to emit method
277 invocation stuff for the case when we have a user defined operator. I am
278 just not able to get it right !
280 2001-09-17 Miguel de Icaza <miguel@ximian.com>
282 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
285 (Expression::MemberLookup): Provide a version that allows to
286 specify the MemberTypes and BindingFlags.
288 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
289 so it was not fetching variable information from outer blocks.
291 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
292 Beforefieldinit as it was buggy.
294 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
297 * class.cs (Constructor::Emit): Only emit if block is not null.
298 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
299 deal with this by semantically definining it as if the user had
302 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
303 constructors as we now "emit" them at a higher level.
305 (TypeContainer::DefineDefaultConstructor): Used to define the
306 default constructors if none was provided.
308 (ConstructorInitializer): Add methods Resolve and Emit.
310 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
312 2001-09-17 Ravi Pratap <ravi@ximian.com>
314 * class.cs (TypeContainer::EmitDefaultConstructor): Register
315 the default constructor builder with our hashtable for methodbuilders
318 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
319 and argument_count is 0 in which case we have a match.
320 (Binary::ResolveOperator): More null checking and miscellaneous coding
323 2001-09-17 Ravi Pratap <ravi@ximian.com>
325 * rootcontext.cs (IsNameSpace): Compare against null.
327 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
329 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
332 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
335 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
336 we have overloaded operators.
337 (Binary::ResolveOperator): Implement the part which does the operator overload
340 * class.cs (Operator::Emit): Implement.
341 (TypeContainer::Emit): Emit the operators we have too.
343 * expression.cs (Binary::Emit): Update to emit the appropriate code for
344 the case when we have a user-defined operator.
346 2001-09-17 Miguel de Icaza <miguel@ximian.com>
348 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
350 2001-09-16 Ravi Pratap <ravi@ximian.com>
352 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
353 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
354 (Constructor::Emit): Implement.
355 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
356 if we have no work to do.
357 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
360 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
361 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
363 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
366 2001-09-15 Ravi Pratap <ravi@ximian.com>
368 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
370 (Tree::RecordNamespace): Method to do what the name says ;-)
371 (Tree::Namespaces): Property to get at the namespaces hashtable.
373 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
376 * rootcontext.cs (IsNamespace): Fixed it :-)
378 2001-09-14 Miguel de Icaza <miguel@ximian.com>
380 * class.cs (TypeContainer::FindMembers): Add support for
382 (MethodCore): New class that encapsulates both the shared aspects
383 of a Constructor and a Method.
384 (Method, Constructor): Factored pieces into MethodCore.
386 * driver.cs: Added --fatal which makes errors throw exceptions.
387 Load System assembly as well as part of the standard library.
389 * report.cs: Allow throwing exceptions on errors for debugging.
391 * modifiers.cs: Do not use `parent', instead use the real type
392 container to evaluate permission settings.
394 * class.cs: Put Ravi's patch back in. He is right, and we will
395 have to cope with the
397 2001-09-14 Ravi Pratap <ravi@ximian.com>
399 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
400 FamORAssem, not FamANDAssem.
402 2001-09-14 Miguel de Icaza <miguel@ximian.com>
404 * driver.cs: Added --parse option that only parses its input files
407 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
408 incorrect. IsTopLevel is not used to tell whether an object is
409 root_types or not (that can be achieved by testing this ==
410 root_types). But to see if this is a top-level *class* (not
411 necessarly our "toplevel" container).
413 2001-09-14 Ravi Pratap <ravi@ximian.com>
415 * enum.cs (Enum::Define): Modify to call the Lookup method on the
416 parent instead of a direct call to GetType.
418 2001-09-14 Ravi Pratap <ravi@ximian.com>
420 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
421 Modifiers.TypeAttr. This should just be a call to that method.
423 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
424 object so that we can determine if we are top-level or not.
426 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
429 * enum.cs (Enum::Define): Ditto.
431 * modifiers.cs (FieldAttr): Re-write.
433 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
434 (TypeContainer::HaveStaticConstructor): New property to provide access
435 to precisely that info.
437 * modifiers.cs (MethodAttr): Re-write.
438 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
440 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
441 of top-level types as claimed.
443 2001-09-13 Miguel de Icaza <miguel@ximian.com>
445 * expression.cs (MemberLookup): Fruitless attempt to lookup
446 constructors. Maybe I need to emit default constructors? That
447 might be it (currently .NET emits this for me automatically).
448 (Invocation::OverloadResolve): Cope with Arguments == null.
449 (Invocation::EmitArguments): new function, shared by the new
451 (Invocation::Emit): Handle static and instance methods. Emit
452 proper call instruction for virtual or non-virtual invocations.
453 (New::Emit): Implement.
454 (New::Resolve): Implement.
455 (MemberAccess:Resolve): Implement.
456 (MethodGroupExpr::InstanceExpression): used conforming to the spec
458 (FieldExpr::Resolve): Set type.
460 * support.cs: Handle empty arguments.
462 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
463 SimpleLookup): Auxiliary routines to help parse a qualifier
466 Update qualifier_identifier rule.
468 * codegen.cs: Removed debugging messages.
470 * class.cs: Make this a global thing, this acts just as a "key" to
471 objects that we might have around.
473 (Populate): Only initialize method_builders_to_methods once.
475 * expression.cs (PropertyExpr): Initialize type from the
478 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
479 Resolve pattern. Attempt to implicitly convert value to boolean.
482 * expression.cs: Set the type for the int32/int32 argument case.
483 (Binary::ResolveOperator): Set the return type to boolean for
484 comparission operators
486 * typemanager.cs: Remove debugging print code.
488 (Invocation::Resolve): resolve type.
490 * class.cs: Allocate a MemberInfo of the correct size, as the code
491 elsewhere depends on the test to reflect the correct contents.
493 (Method::) Keep track of parameters, due to System.Reflection holes
495 (TypeContainer::Populate): Keep track of MethodBuilders to Method
498 (TypeContainer::FindMembers): Use ArrayList and then copy an array
499 of the exact size and return that.
501 (Class::LookupMethodByBuilder): New function that maps
502 MethodBuilders to its methods. Required to locate the information
503 on methods because System.Reflection bit us again.
505 * support.cs: New file, contains an interface ParameterData and
506 two implementations: ReflectionParameters and InternalParameters
507 used to access Parameter information. We will need to grow this
510 * expression.cs (Invocation::GetParameterData): implement a cache
511 and a wrapper around the ParameterData creation for methods.
512 (Invocation::OverloadResolve): Use new code.
514 2001-09-13 Ravi Pratap <ravi@ximian.com>
516 * class.cs (TypeContainer::EmitField): Remove and move into
517 (Field::Define): here and modify accordingly.
518 (Field.FieldBuilder): New member.
519 (TypeContainer::Populate): Update accordingly.
520 (TypeContainer::FindMembers): Implement.
522 2001-09-13 Miguel de Icaza <miguel@ximian.com>
524 * statement.cs: (VariableInfo::VariableType): New field to be
525 initialized with the full type once it is resolved.
527 2001-09-12 Miguel de Icaza <miguel@ximian.com>
529 * parameter.cs (GetParameterInfo): Use a type cache to compute
530 things only once, and to reuse this information
532 * expression.cs (LocalVariableReference::Emit): Implement.
533 (OpcodeCast::Emit): fix.
535 (ParameterReference::Resolve): Implement.
536 (ParameterReference::Emit): Implement.
538 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
539 that are expressions need to stay as Expressions.
541 * typemanager.cs (CSharpName): Returns the C# name of a type if
544 * expression.cs (Expression::ConvertImplicit): New function that
545 implements implicit type conversions.
547 (Expression::ImplicitReferenceConversion): Implements implicit
548 reference conversions.
550 (EmptyCast): New type for transparent casts.
552 (OpcodeCast): New type for casts of types that are performed with
553 a sequence of bytecodes.
555 (BoxedCast): New type used for casting value types into reference
556 types. Emits a box opcode.
558 (Binary::DoNumericPromotions): Implements numeric promotions of
559 and computation of the Binary::Type.
561 (Binary::EmitBranchable): Optimization.
563 (Binary::Emit): Implement code emission for expressions.
565 * typemanager.cs (TypeManager): Added two new core types: sbyte
568 2001-09-12 Ravi Pratap <ravi@ximian.com>
570 * class.cs (TypeContainer::FindMembers): Method which does exactly
571 what Type.FindMembers does, only we don't have to use reflection. No
574 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
575 typecontainer objects as we need to get at them.
576 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
578 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
579 typecontainer object.
581 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
582 of just a Report object.
584 2001-09-11 Ravi Pratap <ravi@ximian.com>
586 * class.cs (Event::Define): Go back to using the prefixes "add_" and
588 (TypeContainer::Populate): Now define the delegates of the type too.
589 (TypeContainer.Delegates): Property to access the list of delegates defined
592 * delegates.cs (Delegate::Define): Implement partially.
594 * modifiers.cs (TypeAttr): Handle more flags.
596 2001-09-11 Ravi Pratap <ravi@ximian.com>
598 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
600 (Operator::Define): Re-write logic to get types by using the LookupType method
601 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
602 (Indexer::Define): Ditto.
603 (Event::Define): Ditto.
604 (Property::Define): Ditto.
606 2001-09-10 Ravi Pratap <ravi@ximian.com>
608 * class.cs (TypeContainer::Populate): Now define operators too.
609 (TypeContainer.Operators): New property to access the list of operators
611 (Operator.OperatorMethodBuilder): New member to hold the method builder
612 for the operator we are defining.
613 (Operator::Define): Implement.
615 2001-09-10 Ravi Pratap <ravi@ximian.com>
617 * class.cs (Event::Define): Make the prefixes of the accessor methods
620 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
621 of the location being passed in too. Ideally, this should go later since all
622 error reporting should be done through the Report object.
624 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
625 (Populate): Iterate thru the indexers we have and define them too.
626 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
627 for the get and set accessors.
628 (Indexer::Define): Implement.
630 2001-09-09 Miguel de Icaza <miguel@ximian.com>
632 * expression.cs (Binary::Resolve): Beginning of it. I scratched
633 my previous implementation, did not work.
635 * typemanager.cs: Add a couple of missing types (the longs).
637 * literal.cs: Use TypeManager.bool_type instead of getting it.
639 * expression.cs (EventExpr): New kind of expressions.
640 (Expressio::ExprClassFromMemberInfo): finish
642 2001-09-08 Miguel de Icaza <miguel@ximian.com>
644 * assign.cs: Emit stores to static fields differently.
646 2001-09-08 Ravi Pratap <ravi@ximian.com>
648 * Merge in changes and adjust code to tackle conflicts. Backed out my
649 code in Assign::Resolve ;-)
651 2001-09-08 Ravi Pratap <ravi@ximian.com>
653 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
654 instead Report.Error and also pass in the location.
655 (CSharpParser::Lexer): New readonly property to return the reference
656 to the Tokenizer object.
657 (declare_local_variables): Use Report.Error with location instead of plain
661 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
662 (Operator.CheckBinaryOperator): Ditto.
664 * cs-parser.jay (operator_declarator): Update accordingly.
666 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
667 (CheckBinaryOperator): Same here.
669 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
670 on the name without any prefixes of namespace names etc. This is because we
671 already might have something already fully qualified like
672 'System.Console.WriteLine'
674 * assign.cs (Resolve): Begin implementation. Stuck ;-)
676 2001-09-07 Ravi Pratap <ravi@ximian.com>
678 * cs-tokenizer.cs (location): Return a string which also contains
681 * expression.cs (ElementAccess): New class for expressions of the
682 type 'element access.'
683 (BaseAccess): New class for expressions of the type 'base access.'
684 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
687 * cs-parser.jay (element_access): Implement action.
688 (base_access): Implement actions.
689 (checked_expression, unchecked_expression): Implement.
691 * cs-parser.jay (local_variable_type): Correct and implement.
692 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
694 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
696 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
697 name and the specifiers.
699 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
701 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
702 making them all public ;-)
704 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
707 2001-09-07 Miguel de Icaza <miguel@ximian.com>
709 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
711 (FieldExpr, PropertyExprs): New resolved expressions.
712 (SimpleName::MemberStaticCheck): Perform static checks for access
713 to non-static fields on static methods. Maybe this should be
714 generalized for MemberAccesses.
715 (SimpleName::ResolveSimpleName): More work on simple name
718 * cs-parser.jay (primary_expression/qualified_identifier): track
721 * codegen.cs (CodeGen::Save): Catch save exception, report error.
722 (EmitContext::EmitBoolExpression): Chain to expression generation
723 instead of temporary hack.
724 (::EmitStatementExpression): Put generic expression code generation.
726 * assign.cs (Assign::Emit): Implement variable assignments to
727 local variables, parameters and fields.
729 2001-09-06 Miguel de Icaza <miguel@ximian.com>
731 * statement.cs (Block::GetVariableInfo): New method, returns the
732 VariableInfo for a variable name in a block.
733 (Block::GetVariableType): Implement in terms of GetVariableInfo
735 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
736 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
738 2001-09-06 Ravi Pratap <ravi@ximian.com>
740 * cs-parser.jay (operator_declaration): Continue on my quest : update
741 to take attributes argument.
742 (event_declaration): Ditto.
743 (enum_declaration): Ditto.
744 (indexer_declaration): Ditto.
746 * class.cs (Operator::Operator): Update constructor accordingly.
747 (Event::Event): Ditto.
749 * delegate.cs (Delegate::Delegate): Same here.
751 * enum.cs (Enum::Enum): Same here.
753 2001-09-05 Ravi Pratap <ravi@ximian.com>
755 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
757 * ../tests/cs0658.cs : New file to demonstrate error 0658.
759 * attribute.cs (Attributes): New class to encapsulate all attributes which were
760 being passed around as an arraylist.
761 (Attributes::AddAttribute): Method to add attribute sections.
763 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
764 (struct_declaration): Update accordingly.
765 (constant_declaration): Update.
766 (field_declaration): Update.
767 (method_header): Update.
768 (fixed_parameter): Update.
769 (parameter_array): Ditto.
770 (property_declaration): Ditto.
771 (destructor_declaration): Ditto.
773 * class.cs (Struct::Struct): Update constructors accordingly.
774 (Class::Class): Ditto.
775 (Field::Field): Ditto.
776 (Method::Method): Ditto.
777 (Property::Property): Ditto.
778 (TypeContainer::OptAttribute): update property's return type.
780 * interface.cs (Interface.opt_attributes): New member.
781 (Interface::Interface): Update to take the extra Attributes argument.
783 * parameter.cs (Parameter::Parameter): Ditto.
785 * constant.cs (Constant::Constant): Ditto.
787 * interface.cs (InterfaceMemberBase): New OptAttributes field.
788 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
789 the attributes as a parameter.
790 (InterfaceProperty): Update constructor call.
791 (InterfaceEvent): Ditto.
792 (InterfaceMethod): Ditto.
793 (InterfaceIndexer): Ditto.
795 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
796 pass the attributes too.
797 (interface_event_declaration): Ditto.
798 (interface_property_declaration): Ditto.
799 (interface_method_declaration): Ditto.
800 (interface_declaration): Ditto.
802 2001-09-05 Miguel de Icaza <miguel@ximian.com>
804 * class.cs (Method::Define): Track the "static Main" definition to
805 create an entry point.
807 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
808 EntryPoint if we find it.
810 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
811 (EmitContext::ig): Make this variable public.
813 * driver.cs: Make the default output file be the first file name
814 with the .exe extension.
816 Detect empty compilations
818 Handle various kinds of output targets. Handle --target and
819 rename -t to --dumper.
821 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
822 methods inherited from Expression return now an Expression. This
823 will is used during the tree rewriting as we resolve them during
826 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
827 the spec. Missing entirely is the information about
828 accessability of elements of it.
830 (Expression::ExprClassFromMemberInfo): New constructor for
831 Expressions that creates a fully initialized Expression based on
832 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
835 (Invocation::Resolve): Begin implementing resolution of invocations.
837 * literal.cs (StringLiteral): Implement Emit.
839 2001-09-05 Ravi Pratap <ravi@ximian.com>
841 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
844 2001-09-04 Ravi Pratap <ravi@ximian.com>
846 * cs-parser.jay (attribute_arguments): Implement actions.
847 (attribute): Fix bug in production. Implement action.
848 (attribute_list): Implement.
849 (attribute_target): Implement.
850 (attribute_target_specifier, opt_target_specifier): Implement
851 (CheckAttributeTarget): New method to check if the attribute target
853 (attribute_section): Implement.
854 (opt_attributes): Implement.
856 * attribute.cs : New file to handle attributes.
857 (Attribute): Class to hold attribute info.
859 * cs-parser.jay (opt_attribute_target_specifier): Remove production
860 (attribute_section): Modify production to use 2 different rules to
861 achieve the same thing. 1 s/r conflict down !
862 Clean out commented, useless, non-reducing dimension_separator rules.
864 * class.cs (TypeContainer.attributes): New member to hold list
865 of attributes for a type.
866 (Struct::Struct): Modify to take one more argument, the attribute list.
867 (Class::Class): Ditto.
868 (Field::Field): Ditto.
869 (Method::Method): Ditto.
870 (Property::Property): Ditto.
872 * cs-parser.jay (struct_declaration): Update constructor call to
873 pass in the attributes too.
874 (class_declaration): Ditto.
875 (constant_declaration): Ditto.
876 (field_declaration): Ditto.
877 (method_header): Ditto.
878 (fixed_parameter): Ditto.
879 (parameter_array): Ditto.
880 (property_declaration): Ditto.
882 * constant.cs (Constant::Constant): Update constructor similarly.
883 Use System.Collections.
885 * parameter.cs (Parameter::Parameter): Update as above.
887 2001-09-02 Ravi Pratap <ravi@ximian.com>
889 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
890 (TypeContainer.delegates): New member to hold list of delegates.
892 * cs-parser.jay (delegate_declaration): Implement the action correctly
893 this time as I seem to be on crack ;-)
895 2001-09-02 Miguel de Icaza <miguel@ximian.com>
897 * rootcontext.cs (RootContext::IsNamespace): new function, used to
898 tell whether an identifier represents a namespace.
900 * expression.cs (NamespaceExpr): A namespace expression, used only
901 temporarly during expression resolution.
902 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
903 utility functions to resolve names on expressions.
905 2001-09-01 Miguel de Icaza <miguel@ximian.com>
907 * codegen.cs: Add hook for StatementExpressions.
909 * class.cs: Fix inverted test for static flag in methods.
911 2001-09-02 Ravi Pratap <ravi@ximian.com>
913 * class.cs (Operator::CheckUnaryOperator): Correct error number used
914 to make it coincide with MS' number.
915 (Operator::CheckBinaryOperator): Ditto.
917 * ../errors/errors.txt : Remove error numbers added earlier.
919 * ../errors/cs1019.cs : Test case for error # 1019
921 * ../errros/cs1020.cs : Test case for error # 1020
923 * cs-parser.jay : Clean out commented cruft.
924 (dimension_separators, dimension_separator): Comment out. Ostensibly not
925 used anywhere - non-reducing rule.
926 (namespace_declarations): Non-reducing rule - comment out.
928 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
929 with TypeContainer::AddEnum.
931 * delegate.cs : New file for delegate handling classes.
932 (Delegate): Class for declaring delegates.
936 * cs-parser.jay (delegate_declaration): Implement.
938 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
940 * class.cs (Event::Define): Implement.
941 (Event.EventBuilder): New member.
943 * class.cs (TypeContainer::Populate): Update to define all enums and events
945 (Events): New property for the events arraylist we hold. Shouldn't we move to using
946 readonly fields for all these cases ?
948 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
950 * class.cs (Property): Revamp to use the convention of making fields readonly.
951 Accordingly modify code elsewhere.
953 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
954 the Define method of the Property class.
956 * class.cs : Clean up applied patch and update references to variables etc. Fix
958 (TypeContainer::Populate): Update to define all the properties we have. Also
959 define all enumerations.
961 * enum.cs (Define): Implement.
963 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
965 * cs-parser.jay (overloadable_operator): The semantic value is an
966 enum of the Operator class.
967 (operator_declarator): Implement actions.
968 (operator_declaration): Implement.
970 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
971 validity of definitions.
972 (Operator::CheckBinaryOperator): Static method to check for binary operators
973 (TypeContainer::AddOperator): New method to add an operator to a type.
975 * cs-parser.jay (indexer_declaration): Added line to actually call the
976 AddIndexer method so it gets added ;-)
978 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
979 already taken care of by the MS compiler ?
981 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
983 * class.cs (Operator): New class for operator declarations.
984 (Operator::OpType): Enum for the various operators.
986 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
988 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
989 ostensibly handle this in semantic analysis.
991 * cs-parser.jay (general_catch_clause): Comment out
992 (specific_catch_clauses, specific_catch_clause): Ditto.
993 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
994 (catch_args, opt_catch_args): New productions.
995 (catch_clause): Rewrite to use the new productions above
996 (catch_clauses): Modify accordingly.
997 (opt_catch_clauses): New production to use in try_statement
998 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
999 and re-write the code in the actions to extract the specific and
1000 general catch clauses by being a little smart ;-)
1002 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
1003 Hooray, try and catch statements parse fine !
1005 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1007 * statement.cs (Block::GetVariableType): Fix logic to extract the type
1008 string from the hashtable of variables.
1010 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
1011 I end up making that mistake ;-)
1012 (catch_clauses): Fixed gross error which made Key and Value of the
1013 DictionaryEntry the same : $1 !!
1015 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1017 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
1019 * cs-parser.jay (event_declaration): Correct to remove the semicolon
1020 when the add and remove accessors are specified.
1022 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
1024 * cs-parser.jay (IndexerDeclaration): New helper class to hold
1025 information about indexer_declarator.
1026 (indexer_declarator): Implement actions.
1027 (parsing_indexer): New local boolean used to keep track of whether
1028 we are parsing indexers or properties. This is necessary because
1029 implicit_parameters come into picture even for the get accessor in the
1031 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
1033 * class.cs (Indexer): New class for indexer declarations.
1034 (TypeContainer::AddIndexer): New method to add an indexer to a type.
1035 (TypeContainer::indexers): New member to hold list of indexers for the
1038 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
1040 * cs-parser.jay (add_accessor_declaration): Implement action.
1041 (remove_accessor_declaration): Implement action.
1042 (event_accessors_declaration): Implement
1043 (variable_declarators): swap statements for first rule - trivial.
1045 * class.cs (Event): New class to hold information about event
1047 (TypeContainer::AddEvent): New method to add an event to a type
1048 (TypeContainer::events): New member to hold list of events.
1050 * cs-parser.jay (event_declaration): Implement actions.
1052 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
1054 * cs-parser.jay (dim_separators): Implement. Make it a string
1055 concatenating all the commas together, just as they appear.
1056 (opt_dim_separators): Modify accordingly
1057 (rank_specifiers): Update accordingly. Basically do the same
1058 thing - instead, collect the brackets here.
1059 (opt_rank_sepcifiers): Modify accordingly.
1060 (array_type): Modify to actually return the complete type string
1061 instead of ignoring the rank_specifiers.
1062 (expression_list): Implement to collect the expressions
1063 (variable_initializer): Implement. We make it a list of expressions
1064 essentially so that we can handle the array_initializer case neatly too.
1065 (variable_initializer_list): Implement.
1066 (array_initializer): Make it a list of variable_initializers
1067 (opt_array_initializer): Modify accordingly.
1069 * expression.cs (New::NType): Add enumeration to help us
1070 keep track of whether we have an object/delegate creation
1071 or an array creation.
1072 (New:NewType, New::Rank, New::Indices, New::Initializers): New
1073 members to hold data about array creation.
1074 (New:New): Modify to update NewType
1075 (New:New): New Overloaded contructor for the array creation
1078 * cs-parser.jay (array_creation_expression): Implement to call
1079 the overloaded New constructor.
1081 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
1083 * class.cs (TypeContainer::Constructors): Return member
1084 constructors instead of returning null.
1086 2001-08-26 Miguel de Icaza <miguel@ximian.com>
1088 * typemanager.cs (InitCoreTypes): Initialize the various core
1089 types after we have populated the type manager with the user
1090 defined types (this distinction will be important later while
1091 compiling corlib.dll)
1093 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
1094 on Expression Classification. Now all expressions have a method
1095 `Resolve' and a method `Emit'.
1097 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
1098 generation from working. Also add some temporary debugging
1101 2001-08-24 Miguel de Icaza <miguel@ximian.com>
1103 * codegen.cs: Lots of code generation pieces. This is only the
1104 beginning, will continue tomorrow with more touches of polish. We
1105 handle the fundamentals of if, while, do, for, return. Others are
1106 trickier and I need to start working on invocations soon.
1108 * gen-treedump.cs: Bug fix, use s.Increment here instead of
1111 * codegen.cs (EmitContext): New struct, used during code
1112 emission to keep a context. Most of the code generation will be
1115 * cs-parser.jay: Add embedded blocks to the list of statements of
1116 this block. So code generation proceeds in a top down fashion.
1118 2001-08-23 Miguel de Icaza <miguel@ximian.com>
1120 * statement.cs: Add support for multiple child blocks.
1122 2001-08-22 Miguel de Icaza <miguel@ximian.com>
1124 * codegen.cs (EmitCode): New function, will emit the code for a
1125 Block of code given a TypeContainer and its ILGenerator.
1127 * statement.cs (Block): Standard public readonly optimization.
1128 (Block::Block constructors): Link children.
1129 (Block::Child): Child Linker.
1130 (Block::EmitVariables): Emits IL variable declarations.
1132 * class.cs: Drop support for MethodGroups here, delay until
1134 (Method::): Applied the same simplification that I did before, and
1135 move from Properties to public readonly fields.
1136 (Method::ParameterTypes): Returns the parameter types for the
1137 function, and implements a cache that will be useful later when I
1138 do error checking and the semantic analysis on the methods is
1140 (Constructor::GetCallingConvention): Renamed from CallingConvetion
1141 and made a method, optional argument tells whether this is a class
1142 or a structure to apply the `has-this' bit.
1143 (Method::GetCallingConvention): Implement, returns the calling
1145 (Method::Define): Defines the type, a second pass is performed
1146 later to populate the methods.
1148 (Constructor::ParameterTypes): implement a cache similar to the
1149 one on Method::ParameterTypes, useful later when we do semantic
1152 (TypeContainer::EmitMethod): New method. Emits methods.
1154 * expression.cs: Removed MethodGroup class from here.
1156 * parameter.cs (Parameters::GetCallingConvention): new method.
1158 2001-08-21 Miguel de Icaza <miguel@ximian.com>
1160 * class.cs (TypeContainer::Populate): Drop RootContext from the
1163 (Constructor::CallingConvention): Returns the calling convention.
1164 (Constructor::ParameterTypes): Returns the constructor parameter
1167 (TypeContainer::AddConstructor): Keep track of default constructor
1168 and the default static constructor.
1170 (Constructor::) Another class that starts using `public readonly'
1171 instead of properties.
1173 (Constructor::IsDefault): Whether this is a default constructor.
1175 (Field::) use readonly public fields instead of properties also.
1177 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
1178 track of static constructors; If none is used, turn on
1179 BeforeFieldInit in the TypeAttributes.
1181 * cs-parser.jay (opt_argument_list): now the return can be null
1182 for the cases where there are no arguments.
1184 (constructor_declarator): If there is no implicit `base' or
1185 `this', then invoke the default parent constructor.
1187 * modifiers.cs (MethodAttr): New static function maps a set of
1188 modifiers flags into a MethodAttributes enum
1189 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
1190 MethodAttr, TypeAttr to represent the various mappings where the
1192 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
1194 2001-08-19 Miguel de Icaza <miguel@ximian.com>
1196 * parameter.cs (GetParameterInfo): Fix bug where there would be no
1199 * interface.cs (PopulateIndexer): Implemented the code generator
1200 for interface indexers.
1202 2001-08-17 Miguel de Icaza <miguel@ximian.com>
1204 * interface.cs (InterfaceMemberBase): Now we track the new status
1207 (PopulateProperty): Implement property population. Woohoo! Got
1208 Methods and Properties going today.
1210 Removed all the properties for interfaces, and replaced them with
1211 `public readonly' fields.
1213 2001-08-16 Miguel de Icaza <miguel@ximian.com>
1215 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
1216 initialize their hashtables/arraylists only when they are needed
1217 instead of doing this always.
1219 * parameter.cs: Handle refs and out parameters.
1221 * cs-parser.jay: Use an ArrayList to construct the arguments
1222 instead of the ParameterCollection, and then cast that to a
1225 * parameter.cs: Drop the use of ParameterCollection and use
1226 instead arrays of Parameters.
1228 (GetParameterInfo): Use the Type, not the Name when resolving
1231 2001-08-13 Miguel de Icaza <miguel@ximian.com>
1233 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
1234 and instead use public readonly fields.
1236 * class.cs: Put back walking code for type containers.
1238 2001-08-11 Miguel de Icaza <miguel@ximian.com>
1240 * class.cs (MakeConstant): Code to define constants.
1242 * rootcontext.cs (LookupType): New function. Used to locate types
1245 2001-08-08 Miguel de Icaza <miguel@ximian.com>
1247 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
1248 this System.Reflection code is. Kudos to Microsoft
1250 * typemanager.cs: Implement a type cache and avoid loading all
1251 types at boot time. Wrap in LookupType the internals. This made
1252 the compiler so much faster. Wow. I rule!
1254 * driver.cs: Make sure we always load mscorlib first (for
1255 debugging purposes, nothing really important).
1257 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
1258 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
1260 * rootcontext.cs: Lookup types on their namespace; Lookup types
1261 on namespaces that have been imported using the `using' keyword.
1263 * class.cs (TypeContainer::TypeAttr): Virtualize.
1264 (Class::TypeAttr): Return attributes suitable for this bad boy.
1265 (Struct::TypeAttr): ditto.
1266 Handle nested classes.
1267 (TypeContainer::) Remove all the type visiting code, it is now
1268 replaced with the rootcontext.cs code
1270 * rootcontext.cs (GetClassBases): Added support for structs.
1272 2001-08-06 Miguel de Icaza <miguel@ximian.com>
1274 * interface.cs, statement.cs, class.cs, parameter.cs,
1275 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
1276 Drop use of TypeRefs, and use strings instead.
1278 2001-08-04 Miguel de Icaza <miguel@ximian.com>
1282 * class.cs (Struct::Struct): set the SEALED flags after
1283 checking the modifiers.
1284 (TypeContainer::TypeAttr): new property, returns the
1285 TypeAttributes for a class.
1287 * cs-parser.jay (type_list): Oops, list production was creating a
1288 new list of base types.
1290 * rootcontext.cs (StdLib): New property.
1291 (GetInterfaceTypeByName): returns an interface by type name, and
1292 encapsulates error handling here.
1293 (GetInterfaces): simplified.
1294 (ResolveTree): Encapsulated all the tree resolution here.
1295 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
1298 * driver.cs: Add support for --nostdlib, to avoid loading the
1300 (Main): Do not put tree resolution here.
1302 * rootcontext.cs: Beginning of the class resolution.
1304 2001-08-03 Miguel de Icaza <miguel@ximian.com>
1306 * rootcontext.cs: Provide better error reporting.
1308 * cs-parser.jay (interface_base): set our $$ to be interfaces.
1310 * rootcontext.cs (CreateInterface): Handle the case where there
1311 are no parent interfaces.
1313 (CloseTypes): Routine to flush types at the end.
1314 (CreateInterface): Track types.
1315 (GetInterfaces): Returns an array of Types from the list of
1318 * typemanager.c (AddUserType): Mechanism to track user types (puts
1319 the type on the global type hash, and allows us to close it at the
1322 2001-08-02 Miguel de Icaza <miguel@ximian.com>
1324 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
1325 RecordInterface instead.
1327 * cs-parser.jay: Updated to reflect changes above.
1329 * decl.cs (Definition): Keep track of the TypeBuilder type that
1330 represents this type here. Not sure we will use it in the long
1331 run, but wont hurt for now.
1333 * driver.cs: Smaller changes to accomodate the new code.
1335 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
1338 * rootcontext.cs (CreateInterface): New method, used to create
1339 the System.TypeBuilder type for interfaces.
1340 (ResolveInterfaces): new entry point to resolve the interface
1342 (CodeGen): Property, used to keep track of the code generator.
1344 2001-07-26 Miguel de Icaza <miguel@ximian.com>
1346 * cs-parser.jay: Add a second production for delegate_declaration
1349 (enum_body): Put an opt_comma here instead of putting it on
1350 enum_body or enum_member_declarations so we can handle trailing
1351 commas on enumeration members. Gets rid of a shift/reduce.
1353 (type_list): Need a COMMA in the middle.
1355 (indexer_declaration): Tell tokenizer to recognize get/set
1357 * Remove old targets.
1359 * Re-add the parser target.
1361 2001-07-13 Simon Cozens <simon@simon-cozens.org>
1363 * cs-parser.jay: Add precendence rules for a number of operators
1364 ot reduce the number of shift/reduce conflicts in the grammar.
1366 2001-07-17 Miguel de Icaza <miguel@ximian.com>
1368 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
1371 Get rid of old crufty code.
1373 * rootcontext.cs: Use this to keep track of the parsed
1374 representation and the defined types available to the program.
1376 * gen-treedump.cs: adjust for new convention.
1378 * type.cs: Split out the type manager, and the assembly builder
1381 * typemanager.cs: the type manager will live here now.
1383 * cil-codegen.cs: And the code generator here.
1385 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
1387 * makefile: Fixed up for easy making.
1389 2001-07-13 Simon Cozens <simon@simon-cozens.org>
1391 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
1394 (unary_expression): Expand pre_increment_expression and
1395 post_decrement_expression to reduce a shift/reduce.
1397 2001-07-11 Simon Cozens
1399 * cs-tokenizer.cs: Hex numbers should begin with a 0.
1401 Improve allow_keyword_as_indent name.
1403 2001-06-19 Miguel de Icaza <miguel@ximian.com>
1405 * Adjustments for Beta2.
1407 2001-06-13 Miguel de Icaza <miguel@ximian.com>
1409 * decl.cs: Added `Define' abstract method.
1410 (InTransit): new property, used to catch recursive definitions.
1412 * interface.cs: Implement `Define'.
1414 * modifiers.cs: Map Modifiers.constants to
1415 System.Reflection.TypeAttribute flags.
1417 * class.cs: Keep track of types and user-defined types.
1418 (BuilderInit): New method for creating an assembly
1419 (ResolveType): New function to launch the resolution process, only
1420 used by interfaces for now.
1422 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
1423 that are inserted into the name space.
1425 2001-06-08 Miguel de Icaza <miguel@ximian.com>
1427 * ARGH. I have screwed up my tree so many times due to the use of
1428 rsync rather than using CVS. Going to fix this at once.
1430 * driver.cs: Objetify driver. Load assemblies, use assemblies to
1433 2001-06-07 Miguel de Icaza <miguel@ximian.com>
1435 * Experiment successful: Use System.Type rather that our own
1438 2001-05-25 Miguel de Icaza <miguel@ximian.com>
1440 * cs-parser.jay: Removed nsAliases from here.
1442 Use new namespaces, handle `using XXX;'
1444 * namespace.cs: Reimplemented namespace handling, use a recursive
1445 definition of the class. Now we can keep track of using clauses
1446 and catch invalid using clauses.
1448 2001-05-24 Miguel de Icaza <miguel@ximian.com>
1450 * gen-treedump.cs: Adapted for all the renaming.
1452 * expression.cs (Expression): this class now has a Type property
1453 which returns an expression Type.
1455 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
1456 `Type', as this has a different meaning now in the base
1458 2001-05-22 Miguel de Icaza <miguel@ximian.com>
1460 * interface.cs, class.cs: Removed from all the sources the
1461 references to signature computation, as we can not do method
1462 signature computation during the parsing time, as we are not
1463 trying to solve at that point distinguishing:
1467 void a (NS.Blah x) {}
1470 Which depending on the context might be valid or not, as we do not
1471 know if Blah is the same thing as NS.Blah at that point.
1473 * Redid everything so the code uses TypeRefs now instead of
1474 Types. TypeRefs are just temporary type placeholders, that need
1475 to be resolved. They initially have a pointer to a string and the
1476 current scope in which they are used. This is used later by the
1477 compiler to resolve the reference to an actual Type.
1479 * DeclSpace is no longer a CIR.Type, and neither are
1480 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
1481 are all DeclSpaces, but no Types.
1483 * type.cs (TypeRefManager): This implements the TypeRef manager,
1484 which keeps track of all the types that need to be resolved after
1485 the parsing has finished.
1487 2001-05-13 Miguel de Icaza <miguel@ximian.com>
1489 * ARGH. We are going to have to store `foreach' as a class rather
1490 than resolving it, as we need to verify error 1579 after name
1491 resolution. *OR* we could keep a flag that says `This request to
1492 IEnumerator comes from a foreach statement' which we can then use
1493 to generate the error.
1495 2001-05-10 Miguel de Icaza <miguel@ximian.com>
1497 * class.cs (TypeContainer.AddMethod): we now add methods to the
1498 MethodGroup instead of the method hashtable.
1500 * expression.cs: Add MethodGroup abstraction, which gets us one
1501 step closer to the specification in the way we handle method
1504 * cs-parser.jay (primary_expression): qualified_identifier now
1505 tried to match up an identifier to a local variable reference or
1506 to a parameter reference.
1508 current_local_parameters is now a parser global variable that
1509 points to the current parameters for the block, used during name
1512 (property_declaration): Now creates an implicit `value' argument to
1515 2001-05-09 Miguel de Icaza <miguel@ximian.com>
1517 * parameter.cs: Do not use `param' arguments as part of the
1518 signature, per the spec.
1520 2001-05-08 Miguel de Icaza <miguel@ximian.com>
1522 * decl.cs: Base class for classes, structs and interfaces. This
1523 is the "Declaration Space"
1525 * cs-parser.jay: Use CheckDef for checking declaration errors
1526 instead of having one on each function.
1528 * class.cs: Factor out some code for handling error handling in
1529 accordance to the "Declarations" section in the "Basic Concepts"
1530 chapter in the ECMA C# spec.
1532 * interface.cs: Make all interface member classes derive from
1533 InterfaceMemberBase.
1535 2001-05-07 Miguel de Icaza <miguel@ximian.com>
1537 * Many things: all interfaces are parsed and generated in
1538 gen-treedump. Support for member variables, constructors,
1539 destructors, properties, constants is there.
1541 Beginning of the IL backend, but very little done, just there for
1544 2001-04-29 Miguel de Icaza <miguel@ximian.com>
1546 * cs-parser.jay: Fix labeled statement.
1548 * cs-tokenizer.cs (escape): Escape " and ' always.
1549 ref_line, ref_name: keep track of the line/filename as instructed
1550 by #line by the compiler.
1553 2001-04-27 Miguel de Icaza <miguel@ximian.com>
1555 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
1556 to match the values in System.CodeDOM.
1558 Divid renamed to Divide.
1560 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
1562 (Statements.set): remove.
1564 * System.CodeDOM/CodeCatchClause.cs: always have a valid
1567 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
1568 falseStatements always have valid values.
1570 * cs-parser.jay: Use System.CodeDOM now.