2001-08-22 Miguel de Icaza * codegen.cs (EmitCode): New function, will emit the code for a Block of code given a TypeContainer and its ILGenerator. * statement.cs (Block): Standard public readonly optimization. (Block::Block constructors): Link children. (Block::Child): Child Linker. (Block::EmitVariables): Emits IL variable declarations. * class.cs: Drop support for MethodGroups here, delay until Semantic Analysis. (Method::): Applied the same simplification that I did before, and move from Properties to public readonly fields. (Method::ParameterTypes): Returns the parameter types for the function, and implements a cache that will be useful later when I do error checking and the semantic analysis on the methods is performed. (Constructor::GetCallingConvention): Renamed from CallingConvetion and made a method, optional argument tells whether this is a class or a structure to apply the `has-this' bit. (Method::GetCallingConvention): Implement, returns the calling convention. (Method::Define): Defines the type, a second pass is performed later to populate the methods. (Constructor::ParameterTypes): implement a cache similar to the one on Method::ParameterTypes, useful later when we do semantic analysis. (TypeContainer::EmitMethod): New method. Emits methods. * expression.cs: Removed MethodGroup class from here. * parameter.cs (Parameters::GetCallingConvention): new method. 2001-08-21 Miguel de Icaza * class.cs (TypeContainer::Populate): Drop RootContext from the argument. (Constructor::CallingConvention): Returns the calling convention. (Constructor::ParameterTypes): Returns the constructor parameter types. (TypeContainer::AddConstructor): Keep track of default constructor and the default static constructor. (Constructor::) Another class that starts using `public readonly' instead of properties. (Constructor::IsDefault): Whether this is a default constructor. (Field::) use readonly public fields instead of properties also. (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep track of static constructors; If none is used, turn on BeforeFieldInit in the TypeAttributes. * cs-parser.jay (opt_argument_list): now the return can be null for the cases where there are no arguments. (constructor_declarator): If there is no implicit `base' or `this', then invoke the default parent constructor. * modifiers.cs (MethodAttr): New static function maps a set of modifiers flags into a MethodAttributes enum (FieldAttr): renamed from `Map'. So now we have FieldAttr, MethodAttr, TypeAttr to represent the various mappings where the modifiers are used. (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly' 2001-08-19 Miguel de Icaza * parameter.cs (GetParameterInfo): Fix bug where there would be no method arguments. * interface.cs (PopulateIndexer): Implemented the code generator for interface indexers. 2001-08-17 Miguel de Icaza * interface.cs (InterfaceMemberBase): Now we track the new status here. (PopulateProperty): Implement property population. Woohoo! Got Methods and Properties going today. Removed all the properties for interfaces, and replaced them with `public readonly' fields. 2001-08-16 Miguel de Icaza * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty): initialize their hashtables/arraylists only when they are needed instead of doing this always. * parameter.cs: Handle refs and out parameters. * cs-parser.jay: Use an ArrayList to construct the arguments instead of the ParameterCollection, and then cast that to a Parameter[] array. * parameter.cs: Drop the use of ParameterCollection and use instead arrays of Parameters. (GetParameterInfo): Use the Type, not the Name when resolving types. 2001-08-13 Miguel de Icaza * parameter.cs: Eliminate the properties Name, Type and ModFlags, and instead use public readonly fields. * class.cs: Put back walking code for type containers. 2001-08-11 Miguel de Icaza * class.cs (MakeConstant): Code to define constants. * rootcontext.cs (LookupType): New function. Used to locate types 2001-08-08 Miguel de Icaza * rootcontext.cs: OH MY! My trick works! It is amazing how nice this System.Reflection code is. Kudos to Microsoft * typemanager.cs: Implement a type cache and avoid loading all types at boot time. Wrap in LookupType the internals. This made the compiler so much faster. Wow. I rule! * driver.cs: Make sure we always load mscorlib first (for debugging purposes, nothing really important). * Renamespaced things that were on `CSC' to `CIR'. Maybe I should have moved to `CSC' rather than `CIR'. Oh man! The confussion! * rootcontext.cs: Lookup types on their namespace; Lookup types on namespaces that have been imported using the `using' keyword. * class.cs (TypeContainer::TypeAttr): Virtualize. (Class::TypeAttr): Return attributes suitable for this bad boy. (Struct::TypeAttr): ditto. Handle nested classes. (TypeContainer::) Remove all the type visiting code, it is now replaced with the rootcontext.cs code * rootcontext.cs (GetClassBases): Added support for structs. 2001-08-06 Miguel de Icaza * interface.cs, statement.cs, class.cs, parameter.cs, rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay: Drop use of TypeRefs, and use strings instead. 2001-08-04 Miguel de Icaza * rootcontext.cs: * class.cs (Struct::Struct): set the SEALED flags after checking the modifiers. (TypeContainer::TypeAttr): new property, returns the TypeAttributes for a class. * cs-parser.jay (type_list): Oops, list production was creating a new list of base types. * rootcontext.cs (StdLib): New property. (GetInterfaceTypeByName): returns an interface by type name, and encapsulates error handling here. (GetInterfaces): simplified. (ResolveTree): Encapsulated all the tree resolution here. (CreateClass, GetClassBases, GetInterfaceOrClass): Create class types. * driver.cs: Add support for --nostdlib, to avoid loading the default assemblies. (Main): Do not put tree resolution here. * rootcontext.cs: Beginning of the class resolution. 2001-08-03 Miguel de Icaza * rootcontext.cs: Provide better error reporting. * cs-parser.jay (interface_base): set our $$ to be interfaces. * rootcontext.cs (CreateInterface): Handle the case where there are no parent interfaces. (CloseTypes): Routine to flush types at the end. (CreateInterface): Track types. (GetInterfaces): Returns an array of Types from the list of defined interfaces. * typemanager.c (AddUserType): Mechanism to track user types (puts the type on the global type hash, and allows us to close it at the end). 2001-08-02 Miguel de Icaza * tree.cs: Removed RecordType, added RecordClass, RecordStruct and RecordInterface instead. * cs-parser.jay: Updated to reflect changes above. * decl.cs (Definition): Keep track of the TypeBuilder type that represents this type here. Not sure we will use it in the long run, but wont hurt for now. * driver.cs: Smaller changes to accomodate the new code. Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly when done. * rootcontext.cs (CreateInterface): New method, used to create the System.TypeBuilder type for interfaces. (ResolveInterfaces): new entry point to resolve the interface hierarchy. (CodeGen): Property, used to keep track of the code generator. 2001-07-26 Miguel de Icaza * cs-parser.jay: Add a second production for delegate_declaration with `VOID'. (enum_body): Put an opt_comma here instead of putting it on enum_body or enum_member_declarations so we can handle trailing commas on enumeration members. Gets rid of a shift/reduce. (type_list): Need a COMMA in the middle. (indexer_declaration): Tell tokenizer to recognize get/set * Remove old targets. * Re-add the parser target. 2001-07-13 Simon Cozens * cs-parser.jay: Add precendence rules for a number of operators ot reduce the number of shift/reduce conflicts in the grammar. 2001-07-17 Miguel de Icaza * tree.cs: moved IGenerator interface and renamed it to ITreeDump and put it here. Get rid of old crufty code. * rootcontext.cs: Use this to keep track of the parsed representation and the defined types available to the program. * gen-treedump.cs: adjust for new convention. * type.cs: Split out the type manager, and the assembly builder from here. * typemanager.cs: the type manager will live here now. * cil-codegen.cs: And the code generator here. 2001-07-14 Sean MacIsaac * makefile: Fixed up for easy making. 2001-07-13 Simon Cozens * cs-parser.jay (rank_specifier): Remove a conflict by reordering the (unary_expression): Expand pre_increment_expression and post_decrement_expression to reduce a shift/reduce. 2001-07-11 Simon Cozens * cs-tokenizer.cs: Hex numbers should begin with a 0. Improve allow_keyword_as_indent name. 2001-06-19 Miguel de Icaza * Adjustments for Beta2. 2001-06-13 Miguel de Icaza * decl.cs: Added `Define' abstract method. (InTransit): new property, used to catch recursive definitions. * interface.cs: Implement `Define'. * modifiers.cs: Map Modifiers.constants to System.Reflection.TypeAttribute flags. * class.cs: Keep track of types and user-defined types. (BuilderInit): New method for creating an assembly (ResolveType): New function to launch the resolution process, only used by interfaces for now. * cs-parser.jay: Keep track of Classes, Structs and Interfaces that are inserted into the name space. 2001-06-08 Miguel de Icaza * ARGH. I have screwed up my tree so many times due to the use of rsync rather than using CVS. Going to fix this at once. * driver.cs: Objetify driver. Load assemblies, use assemblies to load types. 2001-06-07 Miguel de Icaza * Experiment successful: Use System.Type rather that our own version of Type. 2001-05-25 Miguel de Icaza * cs-parser.jay: Removed nsAliases from here. Use new namespaces, handle `using XXX;' * namespace.cs: Reimplemented namespace handling, use a recursive definition of the class. Now we can keep track of using clauses and catch invalid using clauses. 2001-05-24 Miguel de Icaza * gen-treedump.cs: Adapted for all the renaming. * expression.cs (Expression): this class now has a Type property which returns an expression Type. (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from `Type', as this has a different meaning now in the base 2001-05-22 Miguel de Icaza * interface.cs, class.cs: Removed from all the sources the references to signature computation, as we can not do method signature computation during the parsing time, as we are not trying to solve at that point distinguishing: class X { void a (Blah x) {} void a (NS.Blah x) {} } Which depending on the context might be valid or not, as we do not know if Blah is the same thing as NS.Blah at that point. * Redid everything so the code uses TypeRefs now instead of Types. TypeRefs are just temporary type placeholders, that need to be resolved. They initially have a pointer to a string and the current scope in which they are used. This is used later by the compiler to resolve the reference to an actual Type. * DeclSpace is no longer a CIR.Type, and neither are TypeContainers (Class and Struct) nor Interfaces nor Enums. They are all DeclSpaces, but no Types. * type.cs (TypeRefManager): This implements the TypeRef manager, which keeps track of all the types that need to be resolved after the parsing has finished. 2001-05-13 Miguel de Icaza * ARGH. We are going to have to store `foreach' as a class rather than resolving it, as we need to verify error 1579 after name resolution. *OR* we could keep a flag that says `This request to IEnumerator comes from a foreach statement' which we can then use to generate the error. 2001-05-10 Miguel de Icaza * class.cs (TypeContainer.AddMethod): we now add methods to the MethodGroup instead of the method hashtable. * expression.cs: Add MethodGroup abstraction, which gets us one step closer to the specification in the way we handle method declarations. * cs-parser.jay (primary_expression): qualified_identifier now tried to match up an identifier to a local variable reference or to a parameter reference. current_local_parameters is now a parser global variable that points to the current parameters for the block, used during name lookup. (property_declaration): Now creates an implicit `value' argument to the set accessor. 2001-05-09 Miguel de Icaza * parameter.cs: Do not use `param' arguments as part of the signature, per the spec. 2001-05-08 Miguel de Icaza * decl.cs: Base class for classes, structs and interfaces. This is the "Declaration Space" * cs-parser.jay: Use CheckDef for checking declaration errors instead of having one on each function. * class.cs: Factor out some code for handling error handling in accordance to the "Declarations" section in the "Basic Concepts" chapter in the ECMA C# spec. * interface.cs: Make all interface member classes derive from InterfaceMemberBase. 2001-05-07 Miguel de Icaza * Many things: all interfaces are parsed and generated in gen-treedump. Support for member variables, constructors, destructors, properties, constants is there. Beginning of the IL backend, but very little done, just there for testing purposes. 2001-04-29 Miguel de Icaza * cs-parser.jay: Fix labeled statement. * cs-tokenizer.cs (escape): Escape " and ' always. ref_line, ref_name: keep track of the line/filename as instructed by #line by the compiler. Parse #line. 2001-04-27 Miguel de Icaza * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum to match the values in System.CodeDOM. Divid renamed to Divide. * System.CodeDOM/CodeForLoopStatement.cs: Always have valid statements. (Statements.set): remove. * System.CodeDOM/CodeCatchClause.cs: always have a valid statements. * System.CodeDOM/CodeIfStatement.cs: trueStatements and falseStatements always have valid values. * cs-parser.jay: Use System.CodeDOM now.