/
ChangeLog
executable file
·1226 lines (848 loc) · 42 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2001-09-17 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs: Fix bug: tree.Namespaces might be null.
2001-09-16 Ravi Pratap <ravi@ximian.com>
* class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
(TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
(Constructor::Emit): Implement.
(EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
if we have no work to do.
(TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
Emit method.
* interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
(Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
* class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
of parent.parent.
2001-09-15 Ravi Pratap <ravi@ximian.com>
* tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
in the source.
(Tree::RecordNamespace): Method to do what the name says ;-)
(Tree::Namespaces): Property to get at the namespaces hashtable.
* cs-parser.jay (namespace_declaration): Call RecordNamespace to
keep track.
* rootcontext.cs (IsNamespace): Fixed it :-)
2001-09-14 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer::FindMembers): Add support for
constructors.
(MethodCore): New class that encapsulates both the shared aspects
of a Constructor and a Method.
(Method, Constructor): Factored pieces into MethodCore.
* driver.cs: Added --fatal which makes errors throw exceptions.
Load System assembly as well as part of the standard library.
* report.cs: Allow throwing exceptions on errors for debugging.
* modifiers.cs: Do not use `parent', instead use the real type
container to evaluate permission settings.
* class.cs: Put Ravi's patch back in. He is right, and we will
have to cope with the
2001-09-14 Ravi Pratap <ravi@ximian.com>
* modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
FamORAssem, not FamANDAssem.
2001-09-14 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Added --parse option that only parses its input files
and terminates.
* class.cs: Reverted last change from Ravi to IsTopLevel. That is
incorrect. IsTopLevel is not used to tell whether an object is
root_types or not (that can be achieved by testing this ==
root_types). But to see if this is a top-level *class* (not
necessarly our "toplevel" container).
2001-09-14 Ravi Pratap <ravi@ximian.com>
* enum.cs (Enum::Define): Modify to call the Lookup method on the
parent instead of a direct call to GetType.
2001-09-14 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::TypeAttr): Remove property code and move it into
Modifiers.TypeAttr. This should just be a call to that method.
* modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
object so that we can determine if we are top-level or not.
* delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
TypeContainer too.
* enum.cs (Enum::Define): Ditto.
* modifiers.cs (FieldAttr): Re-write.
* class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
(TypeContainer::HaveStaticConstructor): New property to provide access
to precisely that info.
* modifiers.cs (MethodAttr): Re-write.
(EventAttr): Remove altogether as there seems to be no ostensible use for it.
* class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
of top-level types as claimed.
2001-09-13 Miguel de Icaza <miguel@ximian.com>
* expression.cs (MemberLookup): Fruitless attempt to lookup
constructors. Maybe I need to emit default constructors? That
might be it (currently .NET emits this for me automatically).
(Invocation::OverloadResolve): Cope with Arguments == null.
(Invocation::EmitArguments): new function, shared by the new
constructor and us.
(Invocation::Emit): Handle static and instance methods. Emit
proper call instruction for virtual or non-virtual invocations.
(New::Emit): Implement.
(New::Resolve): Implement.
(MemberAccess:Resolve): Implement.
(MethodGroupExpr::InstanceExpression): used conforming to the spec
to track instances.
(FieldExpr::Resolve): Set type.
* support.cs: Handle empty arguments.
* cs-parser.jay (CompositeLookup, QualifierIdentifier,
SimpleLookup): Auxiliary routines to help parse a qualifier
identifier.
Update qualifier_identifier rule.
* codegen.cs: Removed debugging messages.
* class.cs: Make this a global thing, this acts just as a "key" to
objects that we might have around.
(Populate): Only initialize method_builders_to_methods once.
* expression.cs (PropertyExpr): Initialize type from the
PropertyType.
* codegen.cs (EmitContext::EmitBoolExpression): Use propper
Resolve pattern. Attempt to implicitly convert value to boolean.
Emit code.
* expression.cs: Set the type for the int32/int32 argument case.
(Binary::ResolveOperator): Set the return type to boolean for
comparission operators
* typemanager.cs: Remove debugging print code.
(Invocation::Resolve): resolve type.
* class.cs: Allocate a MemberInfo of the correct size, as the code
elsewhere depends on the test to reflect the correct contents.
(Method::) Keep track of parameters, due to System.Reflection holes
(TypeContainer::Populate): Keep track of MethodBuilders to Method
mapping here.
(TypeContainer::FindMembers): Use ArrayList and then copy an array
of the exact size and return that.
(Class::LookupMethodByBuilder): New function that maps
MethodBuilders to its methods. Required to locate the information
on methods because System.Reflection bit us again.
* support.cs: New file, contains an interface ParameterData and
two implementations: ReflectionParameters and InternalParameters
used to access Parameter information. We will need to grow this
as required.
* expression.cs (Invocation::GetParameterData): implement a cache
and a wrapper around the ParameterData creation for methods.
(Invocation::OverloadResolve): Use new code.
2001-09-13 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::EmitField): Remove and move into
(Field::Define): here and modify accordingly.
(Field.FieldBuilder): New member.
(TypeContainer::Populate): Update accordingly.
(TypeContainer::FindMembers): Implement.
2001-09-13 Miguel de Icaza <miguel@ximian.com>
* statement.cs: (VariableInfo::VariableType): New field to be
initialized with the full type once it is resolved.
2001-09-12 Miguel de Icaza <miguel@ximian.com>
* parameter.cs (GetParameterInfo): Use a type cache to compute
things only once, and to reuse this information
* expression.cs (LocalVariableReference::Emit): Implement.
(OpcodeCast::Emit): fix.
(ParameterReference::Resolve): Implement.
(ParameterReference::Emit): Implement.
* cs-parser.jay: Fix bug introduced by Ravi, variable initializers
that are expressions need to stay as Expressions.
* typemanager.cs (CSharpName): Returns the C# name of a type if
possible.
* expression.cs (Expression::ConvertImplicit): New function that
implements implicit type conversions.
(Expression::ImplicitReferenceConversion): Implements implicit
reference conversions.
(EmptyCast): New type for transparent casts.
(OpcodeCast): New type for casts of types that are performed with
a sequence of bytecodes.
(BoxedCast): New type used for casting value types into reference
types. Emits a box opcode.
(Binary::DoNumericPromotions): Implements numeric promotions of
and computation of the Binary::Type.
(Binary::EmitBranchable): Optimization.
(Binary::Emit): Implement code emission for expressions.
* typemanager.cs (TypeManager): Added two new core types: sbyte
and byte.
2001-09-12 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::FindMembers): Method which does exactly
what Type.FindMembers does, only we don't have to use reflection. No
implementation yet.
* typemanager.cs (typecontainers): New hashtable to hold the corresponding
typecontainer objects as we need to get at them.
(TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
* rootcontext.cs : Correspondingly modify called to AddUserType to pass the
typecontainer object.
* expression.cs (MemberLookup): Modify signature to take a RootContext object instead
of just a Report object.
2001-09-11 Ravi Pratap <ravi@ximian.com>
* class.cs (Event::Define): Go back to using the prefixes "add_" and
"remove_"
(TypeContainer::Populate): Now define the delegates of the type too.
(TypeContainer.Delegates): Property to access the list of delegates defined
in the type.
* delegates.cs (Delegate::Define): Implement partially.
* modifiers.cs (TypeAttr): Handle more flags.
2001-09-11 Ravi Pratap <ravi@ximian.com>
* class.cs (Indexer::Define): Fix for loop iteration condition to be just <
and not <=
(Operator::Define): Re-write logic to get types by using the LookupType method
instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
(Indexer::Define): Ditto.
(Event::Define): Ditto.
(Property::Define): Ditto.
2001-09-10 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::Populate): Now define operators too.
(TypeContainer.Operators): New property to access the list of operators
in a type.
(Operator.OperatorMethodBuilder): New member to hold the method builder
for the operator we are defining.
(Operator::Define): Implement.
2001-09-10 Ravi Pratap <ravi@ximian.com>
* class.cs (Event::Define): Make the prefixes of the accessor methods
addOn_ and removeOn_
* genericparser.cs (GenericParser::error): Overloaded method to handle the case
of the location being passed in too. Ideally, this should go later since all
error reporting should be done through the Report object.
* class.cs (TypeContainer.Indexers): New property to access the list of indexers.
(Populate): Iterate thru the indexers we have and define them too.
(Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
for the get and set accessors.
(Indexer::Define): Implement.
2001-09-09 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary::Resolve): Beginning of it. I scratched
my previous implementation, did not work.
* typemanager.cs: Add a couple of missing types (the longs).
* literal.cs: Use TypeManager.bool_type instead of getting it.
* expression.cs (EventExpr): New kind of expressions.
(Expressio::ExprClassFromMemberInfo): finish
2001-09-08 Miguel de Icaza <miguel@ximian.com>
* assign.cs: Emit stores to static fields differently.
2001-09-08 Ravi Pratap <ravi@ximian.com>
* Merge in changes and adjust code to tackle conflicts. Backed out my
code in Assign::Resolve ;-)
2001-09-08 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (CheckAttributeTarget): Modify call to error to use
instead Report.Error and also pass in the location.
(CSharpParser::Lexer): New readonly property to return the reference
to the Tokenizer object.
(declare_local_variables): Use Report.Error with location instead of plain
old error.
(CheckDef): Ditto.
* class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
(Operator.CheckBinaryOperator): Ditto.
* cs-parser.jay (operator_declarator): Update accordingly.
* cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
(CheckBinaryOperator): Same here.
* rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
on the name without any prefixes of namespace names etc. This is because we
already might have something already fully qualified like
'System.Console.WriteLine'
* assign.cs (Resolve): Begin implementation. Stuck ;-)
2001-09-07 Ravi Pratap <ravi@ximian.com>
* cs-tokenizer.cs (location): Return a string which also contains
the file name.
* expression.cs (ElementAccess): New class for expressions of the
type 'element access.'
(BaseAccess): New class for expressions of the type 'base access.'
(CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
respectively.
* cs-parser.jay (element_access): Implement action.
(base_access): Implement actions.
(checked_expression, unchecked_expression): Implement.
* cs-parser.jay (local_variable_type): Correct and implement.
(type_suffixes, type_suffix_list, type_suffix): Implement actions.
* cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
* cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
name and the specifiers.
* interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
* rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
making them all public ;-)
* cs-parser.jay (error): Remove entirely as we have an implementation in the base
class anyways.
2001-09-07 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
PropertyExprs.
(FieldExpr, PropertyExprs): New resolved expressions.
(SimpleName::MemberStaticCheck): Perform static checks for access
to non-static fields on static methods. Maybe this should be
generalized for MemberAccesses.
(SimpleName::ResolveSimpleName): More work on simple name
resolution.
* cs-parser.jay (primary_expression/qualified_identifier): track
the parameter index.
* codegen.cs (CodeGen::Save): Catch save exception, report error.
(EmitContext::EmitBoolExpression): Chain to expression generation
instead of temporary hack.
(::EmitStatementExpression): Put generic expression code generation.
* assign.cs (Assign::Emit): Implement variable assignments to
local variables, parameters and fields.
2001-09-06 Miguel de Icaza <miguel@ximian.com>
* statement.cs (Block::GetVariableInfo): New method, returns the
VariableInfo for a variable name in a block.
(Block::GetVariableType): Implement in terms of GetVariableInfo
* literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
2001-09-06 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (operator_declaration): Continue on my quest : update
to take attributes argument.
(event_declaration): Ditto.
(enum_declaration): Ditto.
(indexer_declaration): Ditto.
* class.cs (Operator::Operator): Update constructor accordingly.
(Event::Event): Ditto.
* delegate.cs (Delegate::Delegate): Same here.
* enum.cs (Enum::Enum): Same here.
2001-09-05 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
* ../tests/cs0658.cs : New file to demonstrate error 0658.
* attribute.cs (Attributes): New class to encapsulate all attributes which were
being passed around as an arraylist.
(Attributes::AddAttribute): Method to add attribute sections.
* cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
(struct_declaration): Update accordingly.
(constant_declaration): Update.
(field_declaration): Update.
(method_header): Update.
(fixed_parameter): Update.
(parameter_array): Ditto.
(property_declaration): Ditto.
(destructor_declaration): Ditto.
* class.cs (Struct::Struct): Update constructors accordingly.
(Class::Class): Ditto.
(Field::Field): Ditto.
(Method::Method): Ditto.
(Property::Property): Ditto.
(TypeContainer::OptAttribute): update property's return type.
* interface.cs (Interface.opt_attributes): New member.
(Interface::Interface): Update to take the extra Attributes argument.
* parameter.cs (Parameter::Parameter): Ditto.
* constant.cs (Constant::Constant): Ditto.
* interface.cs (InterfaceMemberBase): New OptAttributes field.
(InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
the attributes as a parameter.
(InterfaceProperty): Update constructor call.
(InterfaceEvent): Ditto.
(InterfaceMethod): Ditto.
(InterfaceIndexer): Ditto.
* cs-parser.jay (interface_indexer_declaration): Update call to constructor to
pass the attributes too.
(interface_event_declaration): Ditto.
(interface_property_declaration): Ditto.
(interface_method_declaration): Ditto.
(interface_declaration): Ditto.
2001-09-05 Miguel de Icaza <miguel@ximian.com>
* class.cs (Method::Define): Track the "static Main" definition to
create an entry point.
* rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
EntryPoint if we find it.
* codegen.cs (EmitContext::EmitInvocation): Emit invocations.
(EmitContext::ig): Make this variable public.
* driver.cs: Make the default output file be the first file name
with the .exe extension.
Detect empty compilations
Handle various kinds of output targets. Handle --target and
rename -t to --dumper.
* expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
methods inherited from Expression return now an Expression. This
will is used during the tree rewriting as we resolve them during
semantic analysis.
(Expression::MemberLookup): Implements the MemberLookup (7.3) from
the spec. Missing entirely is the information about
accessability of elements of it.
(Expression::ExprClassFromMemberInfo): New constructor for
Expressions that creates a fully initialized Expression based on
a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
a Type.
(Invocation::Resolve): Begin implementing resolution of invocations.
* literal.cs (StringLiteral): Implement Emit.
2001-09-05 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (error): Add new modifier because we are hiding an inherited
member.
2001-09-04 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (attribute_arguments): Implement actions.
(attribute): Fix bug in production. Implement action.
(attribute_list): Implement.
(attribute_target): Implement.
(attribute_target_specifier, opt_target_specifier): Implement
(CheckAttributeTarget): New method to check if the attribute target
is valid.
(attribute_section): Implement.
(opt_attributes): Implement.
* attribute.cs : New file to handle attributes.
(Attribute): Class to hold attribute info.
* cs-parser.jay (opt_attribute_target_specifier): Remove production
(attribute_section): Modify production to use 2 different rules to
achieve the same thing. 1 s/r conflict down !
Clean out commented, useless, non-reducing dimension_separator rules.
* class.cs (TypeContainer.attributes): New member to hold list
of attributes for a type.
(Struct::Struct): Modify to take one more argument, the attribute list.
(Class::Class): Ditto.
(Field::Field): Ditto.
(Method::Method): Ditto.
(Property::Property): Ditto.
* cs-parser.jay (struct_declaration): Update constructor call to
pass in the attributes too.
(class_declaration): Ditto.
(constant_declaration): Ditto.
(field_declaration): Ditto.
(method_header): Ditto.
(fixed_parameter): Ditto.
(parameter_array): Ditto.
(property_declaration): Ditto.
* constant.cs (Constant::Constant): Update constructor similarly.
Use System.Collections.
* parameter.cs (Parameter::Parameter): Update as above.
2001-09-02 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::AddDelegate): New method to add a delegate.
(TypeContainer.delegates): New member to hold list of delegates.
* cs-parser.jay (delegate_declaration): Implement the action correctly
this time as I seem to be on crack ;-)
2001-09-02 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs (RootContext::IsNamespace): new function, used to
tell whether an identifier represents a namespace.
* expression.cs (NamespaceExpr): A namespace expression, used only
temporarly during expression resolution.
(Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
utility functions to resolve names on expressions.
2001-09-01 Miguel de Icaza <miguel@ximian.com>
* codegen.cs: Add hook for StatementExpressions.
* class.cs: Fix inverted test for static flag in methods.
2001-09-02 Ravi Pratap <ravi@ximian.com>
* class.cs (Operator::CheckUnaryOperator): Correct error number used
to make it coincide with MS' number.
(Operator::CheckBinaryOperator): Ditto.
* ../errors/errors.txt : Remove error numbers added earlier.
* ../errors/cs1019.cs : Test case for error # 1019
* ../errros/cs1020.cs : Test case for error # 1020
* cs-parser.jay : Clean out commented cruft.
(dimension_separators, dimension_separator): Comment out. Ostensibly not
used anywhere - non-reducing rule.
(namespace_declarations): Non-reducing rule - comment out.
* enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
with TypeContainer::AddEnum.
* delegate.cs : New file for delegate handling classes.
(Delegate): Class for declaring delegates.
* makefile : Update.
* cs-parser.jay (delegate_declaration): Implement.
2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
* class.cs (Event::Define): Implement.
(Event.EventBuilder): New member.
* class.cs (TypeContainer::Populate): Update to define all enums and events
we have.
(Events): New property for the events arraylist we hold. Shouldn't we move to using
readonly fields for all these cases ?
2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
* class.cs (Property): Revamp to use the convention of making fields readonly.
Accordingly modify code elsewhere.
* class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
the Define method of the Property class.
* class.cs : Clean up applied patch and update references to variables etc. Fix
trivial bug.
(TypeContainer::Populate): Update to define all the properties we have. Also
define all enumerations.
* enum.cs (Define): Implement.
2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
* cs-parser.jay (overloadable_operator): The semantic value is an
enum of the Operator class.
(operator_declarator): Implement actions.
(operator_declaration): Implement.
* class.cs (Operator::CheckUnaryOperator): New static method to help in checking
validity of definitions.
(Operator::CheckBinaryOperator): Static method to check for binary operators
(TypeContainer::AddOperator): New method to add an operator to a type.
* cs-parser.jay (indexer_declaration): Added line to actually call the
AddIndexer method so it gets added ;-)
* ../errors/errors.txt : Update to include new error numbers. Are these numbers
already taken care of by the MS compiler ?
2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
* class.cs (Operator): New class for operator declarations.
(Operator::OpType): Enum for the various operators.
2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
* class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
ostensibly handle this in semantic analysis.
* cs-parser.jay (general_catch_clause): Comment out
(specific_catch_clauses, specific_catch_clause): Ditto.
(opt_general_catch_clause, opt_specific_catch_clauses): Ditto
(catch_args, opt_catch_args): New productions.
(catch_clause): Rewrite to use the new productions above
(catch_clauses): Modify accordingly.
(opt_catch_clauses): New production to use in try_statement
(try_statement): Revamp. Basically, we get rid of one unnecessary rule
and re-write the code in the actions to extract the specific and
general catch clauses by being a little smart ;-)
* ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
Hooray, try and catch statements parse fine !
2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
* statement.cs (Block::GetVariableType): Fix logic to extract the type
string from the hashtable of variables.
* cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
I end up making that mistake ;-)
(catch_clauses): Fixed gross error which made Key and Value of the
DictionaryEntry the same : $1 !!
2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
* cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
* cs-parser.jay (event_declaration): Correct to remove the semicolon
when the add and remove accessors are specified.
2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
* cs-parser.jay (IndexerDeclaration): New helper class to hold
information about indexer_declarator.
(indexer_declarator): Implement actions.
(parsing_indexer): New local boolean used to keep track of whether
we are parsing indexers or properties. This is necessary because
implicit_parameters come into picture even for the get accessor in the
case of an indexer.
(get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
* class.cs (Indexer): New class for indexer declarations.
(TypeContainer::AddIndexer): New method to add an indexer to a type.
(TypeContainer::indexers): New member to hold list of indexers for the
type.
2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
* cs-parser.jay (add_accessor_declaration): Implement action.
(remove_accessor_declaration): Implement action.
(event_accessors_declaration): Implement
(variable_declarators): swap statements for first rule - trivial.
* class.cs (Event): New class to hold information about event
declarations.
(TypeContainer::AddEvent): New method to add an event to a type
(TypeContainer::events): New member to hold list of events.
* cs-parser.jay (event_declaration): Implement actions.
2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
* cs-parser.jay (dim_separators): Implement. Make it a string
concatenating all the commas together, just as they appear.
(opt_dim_separators): Modify accordingly
(rank_specifiers): Update accordingly. Basically do the same
thing - instead, collect the brackets here.
(opt_rank_sepcifiers): Modify accordingly.
(array_type): Modify to actually return the complete type string
instead of ignoring the rank_specifiers.
(expression_list): Implement to collect the expressions
(variable_initializer): Implement. We make it a list of expressions
essentially so that we can handle the array_initializer case neatly too.
(variable_initializer_list): Implement.
(array_initializer): Make it a list of variable_initializers
(opt_array_initializer): Modify accordingly.
* expression.cs (New::NType): Add enumeration to help us
keep track of whether we have an object/delegate creation
or an array creation.
(New:NewType, New::Rank, New::Indices, New::Initializers): New
members to hold data about array creation.
(New:New): Modify to update NewType
(New:New): New Overloaded contructor for the array creation
case.
* cs-parser.jay (array_creation_expression): Implement to call
the overloaded New constructor.
2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
* class.cs (TypeContainer::Constructors): Return member
constructors instead of returning null.
2001-08-26 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (InitCoreTypes): Initialize the various core
types after we have populated the type manager with the user
defined types (this distinction will be important later while
compiling corlib.dll)
* expression.cs, literal.cs, assign.cs, constant.cs: Started work
on Expression Classification. Now all expressions have a method
`Resolve' and a method `Emit'.
* codegen.cs, cs-parser.jay: Fixed the bug that stopped code
generation from working. Also add some temporary debugging
code.
2001-08-24 Miguel de Icaza <miguel@ximian.com>
* codegen.cs: Lots of code generation pieces. This is only the
beginning, will continue tomorrow with more touches of polish. We
handle the fundamentals of if, while, do, for, return. Others are
trickier and I need to start working on invocations soon.
* gen-treedump.cs: Bug fix, use s.Increment here instead of
s.InitStatement.
* codegen.cs (EmitContext): New struct, used during code
emission to keep a context. Most of the code generation will be
here.
* cs-parser.jay: Add embedded blocks to the list of statements of
this block. So code generation proceeds in a top down fashion.
2001-08-23 Miguel de Icaza <miguel@ximian.com>
* statement.cs: Add support for multiple child blocks.
2001-08-22 Miguel de Icaza <miguel@ximian.com>
* 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 <miguel@ximian.com>
* 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 <miguel@ximian.com>
* 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 <miguel@ximian.com>
* 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 <miguel@ximian.com>
* 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 <miguel@ximian.com>
* 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 <miguel@ximian.com>
* class.cs (MakeConstant): Code to define constants.
* rootcontext.cs (LookupType): New function. Used to locate types
2001-08-08 Miguel de Icaza <miguel@ximian.com>
* 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 <miguel@ximian.com>
* 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 <miguel@ximian.com>
* 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 <miguel@ximian.com>
* 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 <miguel@ximian.com>
* 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 <miguel@ximian.com>